summaryrefslogtreecommitdiff
path: root/toc.c
diff options
context:
space:
mode:
Diffstat (limited to 'toc.c')
-rw-r--r--toc.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/toc.c b/toc.c
index 0bdbb1e..cd19afb 100644
--- a/toc.c
+++ b/toc.c
@@ -18,11 +18,27 @@
#include <float.h>
#include <inttypes.h>
+
+#ifdef __cplusplus
+#define new new_
+#define this this_
+#elif __STDC_VERSION__ < 199901
+#define inline
+#endif
+
#include "types.h"
/* forward declarations for debugging */
static void print_val(Value v, Type *t);
+static void fprint_char_literal(FILE *f, char c) {
+ if (isprint(c))
+ fprintf(f, "'%c'", c);
+ else
+ fprintf(f, "'\\x%02x'", c);
+}
+
+
/* utilities */
#include "allocator.c"
#include "arr.c"
@@ -52,3 +68,12 @@ static bool typedefs_file(CGenerator *g, ParsedFile *f);
#ifdef TOC_DEBUG
#include "tests.c"
#endif
+
+
+
+#ifdef __cplusplus
+#undef new
+#undef this
+#elif __STDC_VERSION__ < 199901
+#undef inline
+#endif