Hi
I noticed that these defines (line 35 to 37) are hardcoded in the DataTypes.h include file:
Hi
I noticed that these defines (line 35 to 37) are hardcoded in the DataTypes.h include file:
Henrik Bach wrote:
Hi
I noticed that these defines (line 35 to 37) are hardcoded in the DataTypes.h include file:
----------------
#define HAVE_SYS_TYPES_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1
----------------Shouldn't they have be defined by the configure script into llvm/Config/config.h?
These lines are set by the configure script (checkout DataTypes.h.in in the source tree in the same directory).
The DataTypes.h file, as I understand it, is a public header that is used by programs outside of the LLVM source base. Because of that, we don't want to #include config.h, as most projects have their own config.h. However, it still needs to get these macros.
To fix this, the configure script sets these macros in the DataTypes.h file directly (similar to what it does for config.h). In this way, DataTypes.h works on the platform for which it has been configured, but external programs that #include it don't get conflicts with their own config.h file.
Reid can probably give you a better explanation.
-- John T.
To be more precise, include/llvm/Support/DataTypes.h.in is the source
file, and DataTypes.h is the output file created by configure.