Created
April 24, 2017 00:34
-
-
Save xgalaxy/d76dc46145b7ca3cbc24a4836fd03c78 to your computer and use it in GitHub Desktop.
Easy preprocessor defines
This file contains 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
// From: http://www.codersnotes.com/notes/easy-preprocessor-defines/ | |
#define ON + | |
#define OFF - | |
#define USING(x) ((1 x 1) == 2) | |
// Example usage: | |
#define BIG_ENDIAN ON | |
#if USING(BIG_ENDIAN) | |
// do whatever | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment