prepare-headers: work around another incompatibility between CGBase and newlib

This commit is contained in:
Wolfgang Thaller 2017-10-07 16:09:00 +02:00
parent b2790cf0fb
commit 9edd199c83
1 changed files with 6 additions and 1 deletions

View File

@ -132,19 +132,24 @@ cat > $OUT/CGBase.h <<END_MARKER
#ifndef __CGBASE__WRAP__
#define __CGBASE__WRAP__
#include "math.h"
#include <math.h>
#include <sys/types.h>
/* CGBase contains a hardcoded #ifdef that decides that stdint.h is available in MWERKS > 0x2300.
... otherwise, it contains an incompatible redefinition. */
#pragma push_macro("__MWERKS__")
#define __MWERKS__ 0x6666
#define u_int32_t __cgbase_incompatible_u_int32_t
END_MARKER
sed 's/\r$//' < $IN/CGBase.h | tr '\r' '\n' >> $OUT/CGBase.h
cat >> $OUT/CGBase.h <<END_MARKER
#undef u_int32_t __cgbase_incompatible_u_int32_t
#pragma pop_macro("__MWERKS__")
#endif /* __CGBASE__WRAP__ */