#include "stdio.h"
#define GENERIC_MAX(type) \
type type##_max(type x,type y) \
{ \
return x>y?x:y; \
}
typedef unsigned long ULONG;
GENERIC_MAX(ULONG)
int main(void)
{
printf("%ld\n",ULONG_max(2,4));
return 0;
}
Google returns hundreds of links, try this:Thank you. But there is a problem using codeblocks. I add -E to "settings -> Compiler settings -> Other compiler options", as the picture 1 illustrated, and click the "Build" button, an error appeared, as the picture 2 illustrated.
https://stackoverflow.com/questions/3916979/how-do-i-run-the-gcc-preprocessor-to-get-the-code-after-macros-like-define-are (https://stackoverflow.com/questions/3916979/how-do-i-run-the-gcc-preprocessor-to-get-the-code-after-macros-like-define-are)
The -E option can be added in Project build settings -> Compiler settings -> Other compiler options
The -E output breaks the automated building. You can try using the Tools+ plugin with command line "gcc -E $(ACTIVE_EDITOR_FILENAME)" (I have never used this plugin, so I can't help you here).It seems that "gcc -E test.c >test.txt" works very well for solving this question, although a little troublesome, it doesn't matter.