diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2011-02-10 18:28:04 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2011-03-18 18:03:35 (GMT) |
commit | 4f252abea5f1d17c60f6ff115c9c44cc0b6f1df6 (patch) | |
tree | cd67d837e0e6e60b9e46fdb26055329f2ae588bd /Modules/CheckPrototypeDefinition.c.in | |
parent | 96453cea6ae9d41e83d8148539acc614e6316abd (diff) | |
download | CMake-4f252abea5f1d17c60f6ff115c9c44cc0b6f1df6.zip CMake-4f252abea5f1d17c60f6ff115c9c44cc0b6f1df6.tar.gz CMake-4f252abea5f1d17c60f6ff115c9c44cc0b6f1df6.tar.bz2 |
Modules: Added CheckPrototypeDefinition module.
This check if the function exists and the prototype we want to use is
correct. There are still functions which have different prototypes on
different UNIX systems.
Diffstat (limited to 'Modules/CheckPrototypeDefinition.c.in')
-rw-r--r-- | Modules/CheckPrototypeDefinition.c.in | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/Modules/CheckPrototypeDefinition.c.in b/Modules/CheckPrototypeDefinition.c.in new file mode 100644 index 0000000..a97344a --- /dev/null +++ b/Modules/CheckPrototypeDefinition.c.in @@ -0,0 +1,29 @@ +@CHECK_PROTOTYPE_DEFINITION_HEADER@ + +static void cmakeRequireSymbol(int dummy, ...) { + (void) dummy; +} + +static void checkSymbol(void) { +#ifndef @CHECK_PROTOTYPE_DEFINITION_SYMBOL@ + cmakeRequireSymbol(0, &@CHECK_PROTOTYPE_DEFINITION_SYMBOL@); +#endif +} + +@CHECK_PROTOTYPE_DEFINITION_PROTO@ { + return @CHECK_PROTOTYPE_DEFINITION_RETURN@; +} + +#ifdef __CLASSIC_C__ +int main() { + int ac; + char*av[]; +#else +int main(int ac, char *av[]) { +#endif + checkSymbol(); + if (ac > 1000) { + return *av[0]; + } + return 0; +} |