diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-07-14 18:53:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-07-14 18:53:09 +0000 |
commit | 3945f3269b3e2763faa1ab22d225ca4dd1856b82 (patch) | |
tree | 7e96ec768baa3807ce3a1076a74037a287f4caa8 /ccan/ccan/check_type/_info | |
parent | Initial commit. (diff) | |
download | libnvme-c5db69fa99ba733bb136fc2b6fbb4961839f27ea.tar.xz libnvme-c5db69fa99ba733bb136fc2b6fbb4961839f27ea.zip |
Adding upstream version 1.0.upstream/1.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'ccan/ccan/check_type/_info')
-rw-r--r-- | ccan/ccan/check_type/_info | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/ccan/ccan/check_type/_info b/ccan/ccan/check_type/_info new file mode 100644 index 0000000..cc42673 --- /dev/null +++ b/ccan/ccan/check_type/_info @@ -0,0 +1,33 @@ +#include "config.h" +#include <stdio.h> +#include <string.h> + +/** + * check_type - routines for compile time type checking + * + * C has fairly weak typing: ints get automatically converted to longs, signed + * to unsigned, etc. There are some cases where this is best avoided, and + * these macros provide methods for evoking warnings (or build errors) when + * a precise type isn't used. + * + * On compilers which don't support typeof() these routines are less effective, + * since they have to use sizeof() which can only distiguish between types of + * different size. + * + * License: CC0 (Public domain) + * Author: Rusty Russell <rusty@rustcorp.com.au> + */ +int main(int argc, char *argv[]) +{ + if (argc != 2) + return 1; + + if (strcmp(argv[1], "depends") == 0) { +#if !HAVE_TYPEOF + printf("ccan/build_assert\n"); +#endif + return 0; + } + + return 1; +} |