[LLVMdev] Macro redefinitions

OvermindDL1 overminddl1 at gmail.com
Sun Dec 6 21:55:35 PST 2009


In DataTypes.h starting on line 121 are these lines:
#define INT8_C(C)   C
#define UINT8_C(C)  C
#define INT16_C(C)  C
#define UINT16_C(C) C
#define INT32_C(C)  C
#define UINT32_C(C) C ## U
#define INT64_C(C)  ((int64_t) C ## LL)
#define UINT64_C(C) ((uint64_t) C ## ULL)

They are conflicting with the cstdint when we have updated headers in
our MSVC build.  I could have sworn I talked about this before along
with a patch, guess no one ever fixed it, hence consider this a poke.

The above lines should be changed into:

#ifndef INT8_C
# define INT8_C(C)   C
#endif
#ifndef UINT8_C
# define UINT8_C(C)  C
#endif
#ifndef INT16_C
# define INT16_C(C)  C
#endif
#ifndef UINT16_C
# define UINT16_C(C) C
#endif
#ifndef INT32_C
# define INT32_C(C)  C
#endif
#ifndef UINT32_C
# define UINT32_C(C) C ## U
#endif
#ifndef INT64_C
# define INT64_C(C)  ((int64_t) C ## LL)
#endif
#ifndef UINT64_C
# define UINT64_C(C) ((uint64_t) C ## ULL)
#endif

Do note, the above is not correct anyway since it does not cast the
value, but meh, it still works.
I am not sure about the size macro's or the typedefs, but I am not
getting any issues on those...



More information about the llvm-dev mailing list