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

John Criswell criswell at cs.uiuc.edu
Mon Sep 27 07:34:16 PDT 2004


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.

> 
> Henrik
> 
> _________________________________________________________________
> UndgÄ pop-ups med MSN Toolbar -  http://toolbar.msn.dk/ hent den gratis!
> 
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev


-- 
*********************************************************************
* John T. Criswell                         Email: criswell at uiuc.edu *
* Research Programmer                                               *
* University of Illinois at Urbana-Champaign                        *
*                                                                   *
* "It's today!" said Piglet. "My favorite day," said Pooh.          *
*********************************************************************





More information about the llvm-dev mailing list