Eina: mmap: Use HAVE_SIGINT_T instead of ifdefs on WIN32
authorkakaroto <kakaroto@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 18 Sep 2011 21:57:02 +0000 (21:57 +0000)
committerkakaroto <kakaroto@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sun, 18 Sep 2011 21:57:02 +0000 (21:57 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/eina@63461 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

configure.ac
src/lib/eina_mmap.c

index 0702be8..054c0e9 100644 (file)
@@ -358,7 +358,7 @@ AC_HEADER_ASSERT
 AC_HEADER_DIRENT
 AC_HEADER_TIME
 EFL_CHECK_PATH_MAX
-AC_CHECK_HEADERS([unistd.h libgen.h inttypes.h stdint.h sys/types.h])
+AC_CHECK_HEADERS([unistd.h libgen.h inttypes.h stdint.h sys/types.h siginfo.h])
 
 if test "x${ac_cv_header_inttypes_h}" = "xyes" ; then
    EINA_CONFIGURE_HAVE_INTTYPES_H="#define EINA_HAVE_INTTYPES_H"
@@ -377,6 +377,12 @@ AC_SUBST([EINA_CONFIGURE_HAVE_STDINT_H])
 AC_CHECK_SIZEOF([wchar_t])
 EINA_SIZEOF_WCHAR_T=$ac_cv_sizeof_wchar_t
 AC_SUBST([EINA_SIZEOF_WCHAR_T])
+AC_CHECK_TYPES([siginfo_t], [], [],
+   [[#include <signal.h>
+     #if HAVE_SIGINFO_H
+     # include <siginfo.h>
+     #endif
+   ]])
 
 ### Checks for structures
 
index 9a5932e..a226ad2 100644 (file)
@@ -20,7 +20,7 @@
 # include "config.h"
 #endif
 
-#ifndef _WIN32
+#ifdef HAVE_SIGINFO_T
 
 #ifdef STDC_HEADERS
 # include <stdlib.h>
 #include <signal.h>
 #include <errno.h>
 #include <fcntl.h>
-# include <unistd.h>
+#include <unistd.h>
+
+#if HAVE_SIGINFO_H
+# include <siginfo.h>
+#endif
 
 #endif
 
@@ -55,7 +59,8 @@
  *============================================================================*/
 
 static Eina_Bool mmap_safe = EINA_FALSE;
-#ifndef _WIN32
+#ifdef HAVE_SIGINFO_T
+
 static int _eina_mmap_log_dom = -1;
 static int _eina_mmap_zero_fd = -1;
 static long _eina_mmap_pagesize = -1;
@@ -117,7 +122,7 @@ _eina_mmap_safe_sigbus(int sig __UNUSED__,
 EAPI Eina_Bool
 eina_mmap_safety_enabled_set(Eina_Bool enabled)
 {
-#ifdef _WIN32
+#ifndef HAVE_SIGINFO_T
    return EINA_FALSE;
 #else
    if (_eina_mmap_log_dom < 0)