Better headers check.
authorcaro <caro@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 17 Feb 2011 08:34:42 +0000 (08:34 +0000)
committercaro <caro@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 17 Feb 2011 08:34:42 +0000 (08:34 +0000)
Btw, should we include inttypes.h where we include stdint.h ?

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/eina@57114 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

configure.ac
src/lib/eina_hash.c
src/lib/eina_log.c
src/lib/eina_module.c

index ec0d4a1..b22124e 100644 (file)
@@ -330,15 +330,22 @@ fi
 AC_HEADER_ASSERT
 AC_HEADER_DIRENT
 AC_HEADER_TIME
+AC_CHECK_HEADERS([unistd.h libgen.h])
 EFL_CHECK_PATH_MAX
 
 ### Checks for types
 AC_CHECK_HEADER([inttypes.h],
-               [EINA_CONFIGURE_HAVE_INTTYPES_H="#define EINA_HAVE_INTTYPES_H"])
+   [
+    EINA_CONFIGURE_HAVE_INTTYPES_H="#define EINA_HAVE_INTTYPES_H"
+    AC_DEFINE(HAVE_INTTYPES_H, 1, [Define to 1 if you have the <inttypes.h> header file.])
+   ])
 AC_SUBST(EINA_CONFIGURE_HAVE_INTTYPES_H)
 
 AC_CHECK_HEADER([stdint.h],
-               [EINA_CONFIGURE_HAVE_STDINT_H="#define EINA_HAVE_STDINT_H"])
+   [
+    EINA_CONFIGURE_HAVE_STDINT_H="#define EINA_HAVE_STDINT_H"
+    AC_DEFINE(HAVE_STDINT_H, 1, [Define to 1 if you have the <stdint.h> header file.])
+   ])
 AC_SUBST(EINA_CONFIGURE_HAVE_STDINT_H)
 
 AC_CHECK_SIZEOF(wchar_t)
index 18633e7..38c6a61 100644 (file)
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+
 #ifdef _MSC_VER
 # include <Evil.h>
-#else
-# include <stdint.h>
 #endif
 
 #include "eina_config.h"
index 7941667..5073137 100644 (file)
 #include <assert.h>
 #include <errno.h>
 
-#ifndef _MSC_VER
+#ifdef HAVE_UNISTD_H
 # include <unistd.h>
 #endif
 
index e2ca522..5c46b7a 100644 (file)
@@ -42,10 +42,8 @@ void *alloca (size_t);
 #include <dirent.h>
 #include <string.h>
 
-#ifndef _MSC_VER
+#ifdef HAVE_LIBGEN_H
 # include <libgen.h>
-#else
-# include <Evil.h>
 #endif
 
 #include <dlfcn.h>