diff options
| author | Jakob Kaivo <jkk@ung.org> | 2019-01-30 19:10:49 -0500 |
|---|---|---|
| committer | Jakob Kaivo <jkk@ung.org> | 2019-01-30 19:10:49 -0500 |
| commit | 6c33dd897be95bf1b7b43d70d9e5f7ab179f1ea2 (patch) | |
| tree | 6e322b879ee575704cc5128c169b0ad1d66d0bca | |
| parent | 1a9d7ed19bc9f80c0f704918ea74f084e8a522a0 (diff) | |
generate #if lines for headers
| -rw-r--r-- | ftm.m4 | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -0,0 +1,23 @@ + +define(`STDC', + `ifelse($#, 2, + `ifelse($1, 1, `!defined __STDC_VERSION__ || __STDC_VERSION__ <= $2', `defined __STDC_VERSION__ && $1 <= __STDC_VERSION__ && __STDC_VERSION__ <= $2')', + `ifelse($1, 1, `', `defined __STDC_VERSION__ && $1 <= __STDC_VERSION__')') + ') + +define(`POSIX', + `ifelse($#, 2, + `ifelse($1, 1, `defined _POSIX_SOURCE && (!defined _POSIX_C_SOURCE || _POSIX_C_SOURCE <= $2)', `defined _POSIX_C_SOURCE && $1 <= _POSIX_C_SOURCE && _POSIX_C_SOURCE <= $2')', + `ifelse($1, 1, `defined _POSIX_SOURCE', `defined _POSIX_C_SOURCE && $1 <= _POSIX_C_SOURCE')') + ') + +define(`XEXT', `defined _XOPEN_SOURCE && ((defined _XOPEN_SOURCE_EXTENDED && _XOPEN_SOURCE_EXTENDED == 1) || 500 <= _XOPEN_SOURCE)') +define(`XOPEN', + `ifelse($#, 2, + `ifelse($1, 4, `defined _XOPEN_SOURCE && _XOPEN_SOURCE <= $2', + `ifelse($1, 400, `XEXT() && _XOPEN_SOURCE <= $2', + `defined _XOPEN_SOURCE && $1 <= _XOPEN_SOURCE && _XOPEN_SOURCE <= $2')')', + `ifelse($1, 4, `defined _XOPEN_SOURCE', + `ifelse($1, 400, `XEXT())', + `defined _XOPEN_SOURCE && $1 <= _XOPEN_SOURCE')')') + ') |
