X-Git-Url: http://git.ozlabs.org/?a=blobdiff_plain;f=alignof%2F_info.c;fp=alignof%2F_info.c;h=0000000000000000000000000000000000000000;hb=650c775ff00cccd03fc84e7789a03c51d9839004;hp=b5afa025c537b0bac463a7def7783a15d8798d3a;hpb=c8acddea39d222312102952e91c32cfe4dd2cea0;p=ccan diff --git a/alignof/_info.c b/alignof/_info.c deleted file mode 100644 index b5afa025..00000000 --- a/alignof/_info.c +++ /dev/null @@ -1,45 +0,0 @@ -#include -#include -#include "config.h" - -/** - * alignof - ALIGNOF() macro to determine alignment of a type. - * - * Many platforms have requirements that certain types must be aligned - * to certain address boundaries, such as ints needing to be on 4-byte - * boundaries. Attempting to access variables with incorrect - * alignment may cause performance loss or even program failure (eg. a - * bus signal). - * - * There are times which it's useful to be able to programatically - * access these requirements, such as for dynamic allocators. - * - * Example: - * #include - * #include "alignof/alignoff.h" - * - * int main(int argc, char *argv[]) - * { - * char arr[sizeof(int)]; - * - * if ((unsigned long)arr % ALIGNOF(int)) { - * printf("arr %p CANNOT hold an int\n", arr); - * exit(1); - * } else { - * printf("arr %p CAN hold an int\n", arr); - * exit(0); - * } - * } - */ -int main(int argc, char *argv[]) -{ - if (argc != 2) - return 1; - - if (strcmp(argv[1], "depends") == 0) { - printf("build_assert\n"); - return 0; - } - - return 1; -}