grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] implement grub_millisleep in util/misc.c for grub-emu


From: Christian Franke
Subject: Re: [PATCH] implement grub_millisleep in util/misc.c for grub-emu
Date: Sat, 28 Feb 2009 21:51:49 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.16) Gecko/20080702 SeaMonkey/1.1.11

Robert Millan wrote:
On Sun, Feb 15, 2009 at 07:49:38PM +0100, Felix Zielcke wrote:
--- util/misc.c (revision 1996)
+++ util/misc.c (working copy)
@@ -27,6 +27,9 @@
 #include <sys/time.h>
 #include <unistd.h>
+#define _POSIX_C_SOURCE 199309L
+#include <time.h>

I'm not sure this is garanteed to work unless it's defined before any
header is included.  Did it compile without warnings?


At least with glibc headers, the #define from the patch has no effect, because at least unistd.h has already included features.h which handles these settings. There is no warning, because none of the headers define _POSIX_C_SOURCE.

From features.h:
/* If none of the ANSI/POSIX macros are defined, use POSIX.1 and POSIX.2
  (and IEEE Std 1003.1b-1993 unless _XOPEN_SOURCE is defined).  */
#if (...!defined (_POSIX_C_SOURCE)...)
# define _POSIX_SOURCE  1
# if defined _XOPEN_SOURCE ...
#  ...
# else
#  define _POSIX_C_SOURCE       200112L
# endif
#endif

I would suggest to remove the #define and commit the patch.

BTW: compiles fine on Cygwin, with or without the #define.

--
Christian Franke





reply via email to

[Prev in Thread] Current Thread [Next in Thread]