summaryrefslogtreecommitdiff
path: root/infrastructure/m4/ax_check_define_pragma.m4
diff options
context:
space:
mode:
Diffstat (limited to 'infrastructure/m4/ax_check_define_pragma.m4')
-rw-r--r--infrastructure/m4/ax_check_define_pragma.m425
1 files changed, 25 insertions, 0 deletions
diff --git a/infrastructure/m4/ax_check_define_pragma.m4 b/infrastructure/m4/ax_check_define_pragma.m4
new file mode 100644
index 00000000..176faf3d
--- /dev/null
+++ b/infrastructure/m4/ax_check_define_pragma.m4
@@ -0,0 +1,25 @@
+dnl @synopsis AX_CHECK_DEFINE_PRAGMA([ACTION-IF-TRUE], [ACTION-IF-FALSE])
+dnl
+dnl This macro will find out if the compiler will accept #pragma inside a
+dnl #define. HAVE_DEFINE_PRAGMA will be defined if this is the case, and
+dnl ACTION-IF-TRUE and ACTION-IF-FALSE are run as appropriate
+dnl
+dnl @category C
+dnl @author Martin Ebourne
+dnl @version 2005/07/03
+dnl @license AllPermissive
+
+AC_DEFUN([AX_CHECK_DEFINE_PRAGMA], [
+ AC_CACHE_CHECK([for pre-processor pragma defines], [have_define_pragma],
+ [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+ #define TEST_DEFINE #pragma pack(1)
+ TEST_DEFINE
+ ]])],
+ [have_define_pragma=yes], [have_define_pragma=no]
+ )])
+ if test "x$have_define_pragma" = "xyes"; then
+ AC_DEFINE([HAVE_DEFINE_PRAGMA], 1, [Define to 1 if #define of pragmas works])
+ m4_ifvaln([$1],[$1],[:])dnl
+ m4_ifvaln([$2],[else $2])dnl
+ fi
+ ])dnl