diff options
Diffstat (limited to 'share/cmake-3.18/Modules/CheckVariableExists.c')
-rw-r--r-- | share/cmake-3.18/Modules/CheckVariableExists.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/share/cmake-3.18/Modules/CheckVariableExists.c b/share/cmake-3.18/Modules/CheckVariableExists.c new file mode 100644 index 0000000..d68afb4 --- /dev/null +++ b/share/cmake-3.18/Modules/CheckVariableExists.c @@ -0,0 +1,24 @@ +#ifdef CHECK_VARIABLE_EXISTS + +extern int CHECK_VARIABLE_EXISTS; + +# ifdef __CLASSIC_C__ +int main() +{ + int ac; + char* av[]; +# else +int main(int ac, char* av[]) +{ +# endif + if (ac > 1000) { + return *av[0]; + } + return CHECK_VARIABLE_EXISTS; +} + +#else /* CHECK_VARIABLE_EXISTS */ + +# error "CHECK_VARIABLE_EXISTS has to specify the variable" + +#endif /* CHECK_VARIABLE_EXISTS */ |