JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
Automatically check for the presence of nanosleep.
authorJosh Grams <josh@qualdan.com>
Fri, 11 Dec 2009 01:07:01 +0000 (20:07 -0500)
committerJosh Grams <josh@qualdan.com>
Fri, 11 Dec 2009 01:07:01 +0000 (20:07 -0500)
config.h.in
configure.ac
main.c

index 18bd6ab..e3379f1 100644 (file)
@@ -1,4 +1,4 @@
-/* config.h.in.  Generated from configure.in by autoheader.  */
+/* config.h.in.  Generated from configure.ac by autoheader.  */
 
 /* Define to 1 if you have the `atexit' function. */
 #undef HAVE_ATEXIT
@@ -22,6 +22,9 @@
 /* Define to 1 if you have the `memset' function. */
 #undef HAVE_MEMSET
 
+/* Define to 1 if you have the `nanosleep' function. */
+#undef HAVE_NANOSLEEP
+
 /* Define to 1 if you have the `sqrt' function. */
 #undef HAVE_SQRT
 
@@ -52,6 +55,9 @@
 /* Define to 1 if you have the <sys/types.h> header file. */
 #undef HAVE_SYS_TYPES_H
 
+/* Define to 1 if you have the <time.h> header file. */
+#undef HAVE_TIME_H
+
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
@@ -70,6 +76,9 @@
 /* Define to the one symbol short name of this package. */
 #undef PACKAGE_TARNAME
 
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
 /* Define to the version of this package. */
 #undef PACKAGE_VERSION
 
index 1441e4e..36ebf02 100644 (file)
@@ -22,7 +22,7 @@ AM_PATH_SDL($SDL_VERSION,
 )
 
 # Checks for header files.
-AC_CHECK_HEADERS([inttypes.h stddef.h stdlib.h string.h unistd.h])
+AC_CHECK_HEADERS([inttypes.h stddef.h stdlib.h string.h unistd.h time.h])
 
 # Checks for typedefs, structures, and compiler characteristics.
 AC_HEADER_STDBOOL
@@ -35,7 +35,7 @@ AC_TYPE_UINT8_T
 
 # Checks for library functions.
 AC_FUNC_MALLOC
-AC_CHECK_FUNCS([atexit memset sqrt strdup])
+AC_CHECK_FUNCS([atexit memset sqrt strdup nanosleep])
 
 AC_CONFIG_FILES([Makefile])
 AC_OUTPUT
diff --git a/main.c b/main.c
index 514a089..1d4ce85 100644 (file)
--- a/main.c
+++ b/main.c
@@ -138,7 +138,7 @@ extern int optind, opterr, optopt;
 
 // ************************************* FUNCS
 
-#ifdef nanosleep
+#ifdef HAVE_NANOSLEEP
 void
 tiny_sleep() {
        struct timespec t;