From: Victor Julien Date: Wed, 20 Nov 2013 16:22:32 +0000 (+0100) Subject: build-info: add a nicer way of printing atomics support X-Git-Tag: suricata-2.0beta2~143 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F650%2Fhead;p=thirdparty%2Fsuricata.git build-info: add a nicer way of printing atomics support --- diff --git a/src/suricata.c b/src/suricata.c index ef1ef9f338..b4c4a31e74 100644 --- a/src/suricata.c +++ b/src/suricata.c @@ -662,6 +662,30 @@ void SCPrintBuildInfo(void) { } printf("SIMD support: %s\n", features); + /* atomics stuff */ + memset(features, 0x00, sizeof(features)); +#if defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_1) + strlcat(features, "1 ", sizeof(features)); +#endif +#if defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_2) + strlcat(features, "2 ", sizeof(features)); +#endif +#if defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4) + strlcat(features, "4 ", sizeof(features)); +#endif +#if defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8) + strlcat(features, "8 ", sizeof(features)); +#endif +#if defined(__GCC_HAVE_SYNC_COMPARE_AND_SWAP_16) + strlcat(features, "16 ", sizeof(features)); +#endif + if (strlen(features) == 0) { + strlcat(features, "none", sizeof(features)); + } else { + strlcat(features, "byte(s)", sizeof(features)); + } + printf("Atomic intrisics: %s\n", features); + #if __WORDSIZE == 64 bits = "64-bits"; #elif __WORDSIZE == 32 @@ -681,22 +705,6 @@ void SCPrintBuildInfo(void) { printf("C version %"PRIiMAX"\n", (intmax_t)__STDC_VERSION__); #endif -#ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 - printf(" __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1\n"); -#endif -#ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 - printf(" __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2\n"); -#endif -#ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 - printf(" __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4\n"); -#endif -#ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 - printf(" __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8\n"); -#endif -#ifdef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 - printf(" __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16\n"); -#endif - #if __SSP__ == 1 printf("compiled with -fstack-protector\n"); #endif