vinniefalco / Amalgamate

A tool for creating an amalgamation from C and C++ sources
Other
438 stars 76 forks source link

Add support for #pragma once #8

Open DavidYawCSpeed opened 8 years ago

DavidYawCSpeed commented 8 years ago

The method canFileBeReincluded is supposed to return true if including it a second time is supposed to have an effect. For example, if we were #including some data that would go between a "{" and a "}", that would be valid to include multiple times. The method looks for a standard include guard, and returns false, indicating that re-including the file won't accomplish anything. This change adds looking for #pragma once as the first line in the file, in addition for looking for an include guard.