#!/bin/sh

echo Patching $1

cat $1 | \
sed 's/#define *SIZEOF_VOID_P .*/\
#ifdef __LP64__\
  #define SIZEOF_VOID_P	8\
#else\
  #define SIZEOF_VOID_P 4\
#endif/' |\
sed 's/#define *SIZEOF_LONG .*/\
#ifdef __LP64__\
  #define SIZEOF_LONG	8\
#else\
  #define SIZEOF_LONG 4\
#endif/' |\
sed 's/#define *SIZEOF_SIZE_T .*/\
#ifdef __LP64__\
  #define SIZEOF_SIZE_T	8\
#else\
  #define SIZEOF_SIZE_T 4\
#endif/' > /private/tmp/$$.tmp
rm $1
mv /private/tmp/$$.tmp $1
