diff options
| author | 2023-05-19 20:47:22 +0200 | |
|---|---|---|
| committer | 2023-05-19 20:47:22 +0200 | |
| commit | 50255a2e2573b1299010cfcf49021f72290219b3 (patch) | |
| tree | 9c854b81b6248d26f567cf2e48a9ce40cc843370 | |
| parent | 21a432bc746e9d3897d4972a9c17ee99b0c1ecc0 (diff) | |
| download | libplist-50255a2e2573b1299010cfcf49021f72290219b3.tar.gz libplist-50255a2e2573b1299010cfcf49021f72290219b3.tar.bz2 | |
autoconf: Remove unused function checks and fix constructor/destructor attribute check
| -rw-r--r-- | configure.ac | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac index c09c628..d07ff30 100644 --- a/configure.ac +++ b/configure.ac | |||
| @@ -52,7 +52,7 @@ AC_TYPE_UINT32_T | |||
| 52 | AC_TYPE_UINT8_T | 52 | AC_TYPE_UINT8_T |
| 53 | 53 | ||
| 54 | # Checks for library functions. | 54 | # Checks for library functions. |
| 55 | AC_CHECK_FUNCS([asprintf strcasecmp strdup strerror strndup stpcpy vasprintf gmtime_r localtime_r timegm strptime memmem]) | 55 | AC_CHECK_FUNCS([strdup strndup strerror gmtime_r localtime_r timegm strptime memmem]) |
| 56 | 56 | ||
| 57 | # Checking endianness | 57 | # Checking endianness |
| 58 | AC_C_BIGENDIAN([AC_DEFINE([__BIG_ENDIAN__], [1], [big endian])], | 58 | AC_C_BIGENDIAN([AC_DEFINE([__BIG_ENDIAN__], [1], [big endian])], |
| @@ -85,6 +85,15 @@ AC_CACHE_CHECK([wether the C compiler supports constructor/destructor attributes | |||
| 85 | ac_cv_attribute_constructor=no | 85 | ac_cv_attribute_constructor=no |
| 86 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM( | 86 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM( |
| 87 | [[ | 87 | [[ |
| 88 | #ifndef __has_attribute | ||
| 89 | #define __has_attribute(x) 0 | ||
| 90 | #endif | ||
| 91 | #if !__has_attribute(constructor) | ||
| 92 | #error No constructor attribute | ||
| 93 | #endif | ||
| 94 | #if !__has_attribute(destructor) | ||
| 95 | #error No destructor attribute | ||
| 96 | #endif | ||
| 88 | static void __attribute__((constructor)) test_constructor(void) { | 97 | static void __attribute__((constructor)) test_constructor(void) { |
| 89 | } | 98 | } |
| 90 | static void __attribute__((destructor)) test_destructor(void) { | 99 | static void __attribute__((destructor)) test_destructor(void) { |
