Created
September 21, 2024 15:03
-
-
Save denisdemaisbr/fb8a169159da37c471111a89cca2565d to your computer and use it in GitHub Desktop.
c variable macro
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
... | |
#define isEmpty(_str, ...) \ | |
if (!_str || _str[0] == 0x0 || strlen(_str) == 0) { \ | |
if (sizeof((int[]){__VA_ARGS__}) > 1) { \ | |
return __VA_ARGS__; \ | |
} else { \ | |
return; \ | |
} \ | |
} | |
char str[512] = {0}; | |
isEmpty(str); | |
isEmpty(str, -1); | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment