Eina: mmap: Use HAVE_SIGINT_T instead of ifdefs on WIN32

SVN revision: 63461
This commit is contained in:
Youness Alaoui 2011-09-18 21:57:02 +00:00
parent 12b0bf3896
commit 2495880ac0
2 changed files with 16 additions and 5 deletions

View File

@ -358,7 +358,7 @@ AC_HEADER_ASSERT
AC_HEADER_DIRENT AC_HEADER_DIRENT
AC_HEADER_TIME AC_HEADER_TIME
EFL_CHECK_PATH_MAX 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 if test "x${ac_cv_header_inttypes_h}" = "xyes" ; then
EINA_CONFIGURE_HAVE_INTTYPES_H="#define EINA_HAVE_INTTYPES_H" 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]) AC_CHECK_SIZEOF([wchar_t])
EINA_SIZEOF_WCHAR_T=$ac_cv_sizeof_wchar_t EINA_SIZEOF_WCHAR_T=$ac_cv_sizeof_wchar_t
AC_SUBST([EINA_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 ### Checks for structures

View File

@ -20,7 +20,7 @@
# include "config.h" # include "config.h"
#endif #endif
#ifndef _WIN32 #ifdef HAVE_SIGINFO_T
#ifdef STDC_HEADERS #ifdef STDC_HEADERS
# include <stdlib.h> # include <stdlib.h>
@ -41,7 +41,11 @@
#include <signal.h> #include <signal.h>
#include <errno.h> #include <errno.h>
#include <fcntl.h> #include <fcntl.h>
# include <unistd.h> #include <unistd.h>
#if HAVE_SIGINFO_H
# include <siginfo.h>
#endif
#endif #endif
@ -55,7 +59,8 @@
*============================================================================*/ *============================================================================*/
static Eina_Bool mmap_safe = EINA_FALSE; static Eina_Bool mmap_safe = EINA_FALSE;
#ifndef _WIN32 #ifdef HAVE_SIGINFO_T
static int _eina_mmap_log_dom = -1; static int _eina_mmap_log_dom = -1;
static int _eina_mmap_zero_fd = -1; static int _eina_mmap_zero_fd = -1;
static long _eina_mmap_pagesize = -1; static long _eina_mmap_pagesize = -1;
@ -117,7 +122,7 @@ _eina_mmap_safe_sigbus(int sig __UNUSED__,
EAPI Eina_Bool EAPI Eina_Bool
eina_mmap_safety_enabled_set(Eina_Bool enabled) eina_mmap_safety_enabled_set(Eina_Bool enabled)
{ {
#ifdef _WIN32 #ifndef HAVE_SIGINFO_T
return EINA_FALSE; return EINA_FALSE;
#else #else
if (_eina_mmap_log_dom < 0) if (_eina_mmap_log_dom < 0)