This is the mail archive of the
mailing list for the glibc project.
glibc strftime.c _REENTRANT problem (GNU Emacs 20.3, Solaris 2.6)
- To: firstname.lastname@example.org
- Subject: glibc strftime.c _REENTRANT problem (GNU Emacs 20.3, Solaris 2.6)
- From: Paul Eggert <email@example.com>
- Date: Mon, 7 Sep 1998 00:02:26 -0700 (PDT)
On Solaris 2.6, GNU Emacs 20.3's config.h file includes <time.h>
indirectly, which means that the "#define _REENTRANT 1" in glibc
strftime.c is ineffective: it doesn't occur until after config.h is
included. (The explicit "#include <time.h>" in strftime.c has no
effect, since <time.h> was already included by config.h and <time.h>
protects itself against multiple inclusion.)
The symptoms are that localtime_r and gmtime_r are not declared by
<time.h>, which causes compiler complaints on Solaris 2.6.
Here is a patch.
1998-09-06 Paul Eggert <firstname.lastname@example.org>
* strftime.c (_REENTRANT): Define before including <config.h>.
RCS file: strftime.c,v
retrieving revision 126.96.36.199
retrieving revision 188.8.131.52
diff -u -r184.108.40.206 -r220.127.116.11
--- strftime.c 1998/09/07 06:28:58 18.104.22.168
+++ strftime.c 1998/09/07 06:54:16 22.214.171.124
@@ -18,15 +18,17 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-# include <config.h>
-/* Some hosts need this in order to declare localtime_r properly. */
+/* Some hosts need this in order to declare localtime_r properly.
+ This must appear before <config.h> is included, because Emacs's
+ <config.h> includes <time.h> on some hosts. */
# define _REENTRANT 1
+# include <config.h>
# define HAVE_LIMITS_H 1
# define HAVE_MBLEN 1