Created
February 10, 2018 20:55
-
-
Save kazzmir/44cc131b6bd1642e1eede18171849efe to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xyz.h: | |
#ifdef XYZ_HEADER | |
#ifndef XYZ_HEADER_H | |
#define XYZ_HEADER_H | |
void xyz_foo(); | |
#endif | |
#else | |
#include <stdio.h> | |
void xyz_foo(){ | |
printf("hello from xyz\n"); | |
} | |
#endif | |
x.c: | |
#define XYZ_HEADER | |
#include "xyz.h" | |
int main(){ | |
xyz_foo(); | |
} | |
$ gcc -x c x.c xyz.h -o x | |
$ ./x | |
hello from xyz | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment