Use fputc() instead of fputs() to print a single char.
[cparser] / main.c
diff --git a/main.c b/main.c
index d20f550..2497541 100644 (file)
--- a/main.c
+++ b/main.c
 #include "warning.h"
 
 #ifndef PREPROCESSOR
-#define PREPROCESSOR "cpp -std=c99 -U__WCHAR_TYPE__ -D__WCHAR_TYPE__=int -U__SIZE_TYPE__ -D__SIZE_TYPE__=__SIZE_TYPE__ -m32 -U__STRICT_ANSI__"
+#ifdef __APPLE__
+#define PREPROCESSOR "gcc -E -std=c99 -U__WCHAR_TYPE__ -D__WCHAR_TYPE__=int -U__SIZE_TYPE__ -D__SIZE_TYPE__=unsigned\\ long -m32 -U__STRICT_ANSI__"
+#else
+#define PREPROCESSOR "cpp -std=c99 -U__WCHAR_TYPE__ -D__WCHAR_TYPE__=int -U__SIZE_TYPE__ -D__SIZE_TYPE__=unsigned\\ long -m32 -U__STRICT_ANSI__"
+#endif
 #endif
 
 #ifndef LINKER
 #endif
 
 #ifndef ASSEMBLER
+#ifdef __APPLE__
+#define ASSEMBLER "gcc -c -xassembler"
+#else
 #define ASSEMBLER "as --32"
 #endif
+#endif
 
 /** The current c mode/dialect. */
 unsigned int c_mode = _C89|_C99|_GNUC;
@@ -572,6 +580,11 @@ int main(int argc, char **argv)
                break;
        }
 
+#ifdef __APPLE__
+       /* Darwin expects the stack to be aligned to 16byte boundary */
+       firm_be_option("ia32-stackalign=4");
+#endif
+
        /* parse rest of options */
        filetype_t  forced_filetype = FILETYPE_AUTODETECT;
        bool        help_displayed  = false;