Browse Source

Added PREFIX_OBJECT() function to be able to easily prepend any string

to the object name in order to generate e.g. per-file variables.
tags/v0.9.3
Michael Brown 19 years ago
parent
commit
1ddcdb0524
1 changed files with 3 additions and 2 deletions
  1. 3
    2
      src/include/compiler.h

+ 3
- 2
src/include/compiler.h View File

12
 #define _H1( x, y ) x ## y
12
 #define _H1( x, y ) x ## y
13
 #undef _H2
13
 #undef _H2
14
 #define _H2( x, y ) _H1 ( x, y )
14
 #define _H2( x, y ) _H1 ( x, y )
15
-#define OBJECT_SYMBOL _H2 ( obj_, OBJECT )
15
+#define PREFIX_OBJECT(prefix) _H2 ( prefix, OBJECT )
16
+#define OBJECT_SYMBOL PREFIX_OBJECT(obj_)
16
 #undef _STR
17
 #undef _STR
17
 #define _STR(s) #s
18
 #define _STR(s) #s
18
 #undef _XSTR
19
 #undef _XSTR
43
  * DEBUG_LEVEL will be inserted into the object file.
44
  * DEBUG_LEVEL will be inserted into the object file.
44
  *
45
  *
45
  */
46
  */
46
-#define DEBUG_SYMBOL _H2 ( debug_, OBJECT )
47
+#define DEBUG_SYMBOL PREFIX_OBJECT(debug_)
47
 
48
 
48
 #if DEBUG_SYMBOL
49
 #if DEBUG_SYMBOL
49
 #include "console.h"
50
 #include "console.h"

Loading…
Cancel
Save