Re: Defining a CPP macro that defines a macro

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



   #define FIRST_MACRO(a,b) \
   int some_global_var = a; \
   int some_other_global_var = b; \
   extern int some_variable; \
   \#define some_function() some_other_function()

As Ian Lance Taylor noted, this is not possible.  I suggest you do:

| #define FIRST_MACRO(a,b)          \
|    int some_global_var = a;       \
|    int some_other_global_var = b; \
|    extern int some_variable;

And then right after calling the macro, do your define:

| FIRST_MACRO(a, b);
| #define some_function() some_other_function()

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux