summaryrefslogtreecommitdiff
path: root/types.h
diff options
context:
space:
mode:
Diffstat (limited to 'types.h')
-rw-r--r--types.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/types.h b/types.h
index 4918ba1..54ffbda 100644
--- a/types.h
+++ b/types.h
@@ -55,17 +55,20 @@ typedef U32 IdentID; /* identifier ID for cgen (anonymous variables) */
typedef U32 LineNo;
typedef U32 CodePos;
+#define join(a,b) a##b
+
/* for keeping track of whence something came */
#ifdef TOC_DEBUG
#define SOURCE_LOCATION char *src_file; int src_line;
#define SOURCE_LOCATION_PARAMS char *src_file, int src_line,
-#define DEBUG_UNDERSCORE(x) x##_
+#define DEBUG_UNDERSCORE(x) join(x,_)
#else
#define SOURCE_LOCATION
#define SOURCE_LOCATION_PARAMS
#define DEBUG_UNDERSCORE(x) x
#endif
+
typedef struct Location {
LineNo line;
CodePos pos; /* position in ctx->str */