prepare-headers: patches for Carbon

This commit is contained in:
Wolfgang Thaller 2015-09-13 00:42:07 +02:00
parent a295204bf0
commit ce3a2dcc52

View File

@ -5,11 +5,13 @@ OUT=$2
export LANG=en
# cp $IN/[A-Z]*.h $OUT/
for file in $(cd $IN; ls [A-Z]*.h); do
#for file in $(cd $IN; ls [A-Z]*.h); do
for file in $(cd $IN; ls *.h); do
tr '\r' '\n' < $IN/$file > $OUT/$file
#| sed 's/= \(0x[0-9A-Z]*\);/ONEWORDINLINE(\1);/' > $OUT/$file
done
############################# ConditionalMacros.h #############################
cat > $OUT/ConditionalMacros.h <<END_MARKER
#ifndef __CONDITIONALMACROS__WRAP__
@ -43,3 +45,62 @@ cat >> $OUT/ConditionalMacros.h <<END_MARKER
#endif /* __CONDITIONALMACROS__WRAP__ */
END_MARKER
############################# fp.h #############################
if [ -r $IN/fp.h ]; then
cat > $OUT/fp.h <<END_MARKER
#ifndef __FP__WRAP__
#define __FP__WRAP__
#include "math.h"
#pragma push_macro("__MWERKS__")
#define __MWERKS__ 0x6666
#define __cmath__
short relation(double x, double y);
END_MARKER
tr '\r' '\n' < $IN/fp.h >> $OUT/fp.h
cat >> $OUT/fp.h <<END_MARKER
#pragma pop_macro("__MWERKS__")
#undef __cmath__
#endif /* __FP__WRAP__ */
END_MARKER
fi
############################# MixedMode.h #############################
tr '\r' '\n' < $IN/MixedMode.h | sed 's/Opaque\#\#name\#\#\*/Opaque\#\#name \*/g' > $OUT/MixedMode.h
############################# CGBase.h #############################
if [ -r $IN/CGBase.h ]; then
cat > $OUT/CGBase.h <<END_MARKER
#ifndef __CGBASE__WRAP__
#define __CGBASE__WRAP__
#include "math.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
END_MARKER
tr '\r' '\n' < $IN/CGBase.h >> $OUT/CGBase.h
cat >> $OUT/CGBase.h <<END_MARKER
#pragma pop_macro("__MWERKS__")
#endif /* __CGBASE__WRAP__ */
END_MARKER
fi