Skip to content

Instantly share code, notes, and snippets.

@fowlmouth
Last active December 15, 2015 21:09
Show Gist options
  • Save fowlmouth/5323276 to your computer and use it in GitHub Desktop.
Save fowlmouth/5323276 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#define BEGIN {
#define END }
#define SOME_NUMBER 42
int main(int argc, char *argv[]) BEGIN
printf("arg count is %i\n", argc);
printf("some number is %i\n", SOME_NUMBER);
return 0;
END
//FreeImage.h
#ifdef __cplusplus
#define FI_STRUCT(x) struct x
#define FI_ENUM(x) enum x
#else
#define FI_STRUCT(x) typedef struct x x; struct x
#define FI_ENUM(x) typedef int x; enum x
#endif
FI_ENUM(foo) { FOO_A = 0, FOO_B = 1, FOO_C = 3}
FI_STRUCT(bar) { int num; foo baz; }
#include <stdio.h>
#define SOME_NUMBER 42
int main(int argc, char *argv[]) {
printf("arg count is %i\n", argc);
printf("some number is %i\n", SOME_NUMBER);
return 0;
}
//FreeImage.h
typedef int foo; enum foo { FOO_A = 0, FOO_B = 1, FOO_C = 3}
typedef struct bar bar; struct bar { int num; foo baz; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment