[LLVMdev] Hardcoded HAVE_* defines in the DataTypes.h include file

Misha Brukman brukman at uiuc.edu
Mon Sep 27 09:19:17 PDT 2004


On Mon, Sep 27, 2004 at 09:34:16AM -0500, John Criswell wrote:
> Henrik Bach wrote:
> >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).

To be more precise, include/llvm/Support/DataTypes.h.in is the source
file, and DataTypes.h is the output file created by configure.

-- 
Misha Brukman :: http://misha.brukman.net :: http://llvm.cs.uiuc.edu




More information about the llvm-dev mailing list