unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* gnulib strftime imported into Emacs
@ 2011-01-30 23:43 Paul Eggert
  2011-01-31  4:00 ` Eli Zaretskii
                   ` (2 more replies)
  0 siblings, 3 replies; 47+ messages in thread
From: Paul Eggert @ 2011-01-30 23:43 UTC (permalink / raw)
  To: emacs-devel

OK, since the Windows build works with the other gnulib modules,
it's time to try the next one on the list, namely strftime.
I committed to the trunk the following, which migrates Emacs to use
an up-to-date strftime.  This will let us add support for
higher-resolution time stamps in format-time-string, among
other things.  In the patch quoted below, I omit the automatically
generated files.

For Windows I expect that HAVE_STDBOOL_H and HAVE__BOOL should
be 1 in config.h.  You no longer need to worry about HAVE_STRFTIME.
Also, the build procedure needs to be modified to take into account
the fact that strftime.c is now in lib, not in src.

I don't see any major problems here, but I'm not a Windows expert.

=== modified file 'ChangeLog'
--- ChangeLog	2011-01-30 19:22:02 +0000
+++ ChangeLog	2011-01-30 23:29:33 +0000
@@ -1,5 +1,21 @@
 2011-01-30  Paul Eggert  <eggert@cs.ucla.edu>
 
+	strftime: import from gnulib
+	* Makefile.in (GNULIB_MODULES): Add strftime.
+	* configure.in (AC_FUNC_STRFTIME, my_strftime): Remove; no longer
+	needed.
+	* aclocal.m4, configure, lib/Makefile.in, lib/gnulib.mk, m4/gl-comp.m4:
+	Regenerate.
+	* lib/strftime.c, lib/strftime.h, lib/stdbool.in.h: New files,
+	imported from gnulib.
+	* m4/strftime.m4, m4/stdbool.m4, m4/tm_gmtoff.m4: Likewise.
+	This incorporates many changes from gnulib, including simpler
+	handling of multibyte formats, porting to mingw32 and other
+	platforms, and support for higher-resolution time stamps.
+	Emacs does not yet use the higher-resolution interface.
+
+2011-01-30  Paul Eggert  <eggert@cs.ucla.edu>
+
 	gnulib: import mktime and move-if-change fixes from gnulib
 
 	* configure: Regenerate from the following.

=== modified file 'Makefile.in'
--- Makefile.in	2011-01-28 00:25:24 +0000
+++ Makefile.in	2011-01-30 22:41:19 +0000
@@ -330,7 +330,7 @@
 # Update modules from gnulib, for maintainers, who should have it in
 # $(gnulib_srcdir) (relative to $(srcdir) and should have build tools
 # as per $(gnulib_srcdir)/DEPENDENCIES.
-GNULIB_MODULES = dtoastr getopt-gnu mktime
+GNULIB_MODULES = dtoastr getopt-gnu mktime strftime
 GNULIB_TOOL_FLAGS = \
  --import --no-changelog --no-vc-files --makefile-name=gnulib.mk
 sync-from-gnulib: $(gnulib_srcdir)

=== modified file 'admin/ChangeLog'
--- admin/ChangeLog	2011-01-25 05:10:02 +0000
+++ admin/ChangeLog	2011-01-30 23:29:52 +0000
@@ -1,3 +1,8 @@
+2011-01-30  Paul Eggert  <eggert@cs.ucla.edu>
+
+	strftime: import from gnulib
+	* notes/copyright: strftime.c moved from src to lib.
+
 2011-01-25  Glenn Morris  <rgm@gnu.org>
 
 	* bzrmerge.el (bzrmerge-skip-regexp): New variable.

=== modified file 'admin/notes/copyright'
--- admin/notes/copyright	2011-01-25 04:08:28 +0000
+++ admin/notes/copyright	2011-01-30 22:41:19 +0000
@@ -635,7 +635,6 @@
     src/gmalloc.c
     src/md5.c
     src/md5.h
-    src/strftime.c
     src/termcap.c
     src/tparam.c
 

=== modified file 'configure.in'
--- configure.in	2011-01-25 04:08:28 +0000
+++ configure.in	2011-01-30 22:41:19 +0000
@@ -517,7 +517,7 @@
     machine=hp800 opsys=hpux11
     ## FIXME.  Peter O'Gorman reports that dumping using unexelf.o doesn't
     ## work either: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=6811
-    CANNOT_DUMP=yes    
+    CANNOT_DUMP=yes
   ;;
 
   hppa*-*-linux-gnu* )
@@ -2675,8 +2675,6 @@
 gl_ASSERT_NO_GNULIB_TESTS
 gl_INIT
 
-AC_FUNC_STRFTIME
-
 # UNIX98 PTYs.
 AC_CHECK_FUNCS(grantpt)
 
@@ -3528,8 +3526,6 @@
 #endif
 #endif
 
-#define my_strftime nstrftime	/* for strftime.c */
-
 /* These default definitions are good for almost all machines.
    The exceptions override them in m/MACHINE.h.  */
 

=== modified file 'src/ChangeLog'
--- src/ChangeLog	2011-01-30 22:22:58 +0000
+++ src/ChangeLog	2011-01-30 22:58:16 +0000
@@ -1,5 +1,15 @@
 2011-01-30  Paul Eggert  <eggert@cs.ucla.edu>
 
+	strftime: import from gnulib
+	* Makefile.in (obj): Remove strftime.o, as gnulib now does this for us.
+	* deps.mk (strftime.o): Remove.
+	* editfns.c: Include <strftime.h>, supplied by gnulib.
+	(emacs_strftimeu): Remove decl.
+	(emacs_memftimeu): Use nstrftime (the gnulib name) rather than
+	emacs_strftimeu.
+	* config.in: Regenerate.
+	* strftime.c: Remove; we now use strftime from gnulib.
+
 	Use SSDATA when the context wants char *.
 	* alloc.c, buffer.c, bytecode.c, callproc.c, dired.c:
 	* dispnew.c, doc.c, editfns.c, emacs.c, fileio.c, filelock.c:

=== modified file 'src/Makefile.in'
--- src/Makefile.in	2011-01-25 04:08:28 +0000
+++ src/Makefile.in	2011-01-30 22:41:20 +0000
@@ -353,7 +353,7 @@
 	syntax.o $(UNEXEC_OBJ) bytecode.o \
 	process.o gnutls.o callproc.o \
 	region-cache.o sound.o atimer.o \
-	doprnt.o strftime.o intervals.o textprop.o composite.o md5.o xml.o \
+	doprnt.o intervals.o textprop.o composite.o md5.o xml.o \
 	$(MSDOS_OBJ) $(MSDOS_X_OBJ) $(NS_OBJ) $(CYGWIN_OBJ) $(FONT_OBJ)
 
 ## Object files used on some machine or other.

=== modified file 'src/deps.mk'
--- src/deps.mk	2011-01-25 04:08:28 +0000
+++ src/deps.mk	2011-01-30 22:41:20 +0000
@@ -168,7 +168,6 @@
    $(INTERVALS_H) \
    lisp.h $(config_h)
 sound.o: sound.c dispextern.h syssignal.h lisp.h $(config_h) atimer.h systime.h
-strftime.o: strftime.c $(config_h)
 syntax.o: syntax.c syntax.h buffer.h commands.h category.h character.h \
    keymap.h regex.h $(INTERVALS_H) lisp.h $(config_h)
 sysdep.o: sysdep.c syssignal.h systty.h systime.h syswait.h blockinput.h \

=== modified file 'src/editfns.c'
--- src/editfns.c	2011-01-30 22:17:44 +0000
+++ src/editfns.c	2011-01-30 22:48:52 +0000
@@ -45,6 +45,7 @@
 #endif
 
 #include <ctype.h>
+#include <strftime.h>
 
 #include "intervals.h"
 #include "buffer.h"
@@ -82,9 +83,6 @@
     (1000 - TM_YEAR_BASE <= (tm_year) && (tm_year) <= 9999 - TM_YEAR_BASE)
 #endif
 
-extern size_t emacs_strftimeu (char *, size_t, const char *,
-                               const struct tm *, int);
-
 #ifdef WINDOWSNT
 extern Lisp_Object w32_get_internal_run_time (void);
 #endif
@@ -1556,8 +1554,8 @@
    determine how many bytes would be written, use NULL for S and
    ((size_t) -1) for MAXSIZE.
 
-   This function behaves like emacs_strftimeu, except it allows null
-   bytes in FORMAT.  */
+   This function behaves like nstrftime, except it allows null
+   bytes in FORMAT and it does not support nanoseconds.  */
 static size_t
 emacs_memftimeu (char *s, size_t maxsize, const char *format, size_t format_len, const struct tm *tp, int ut)
 {
@@ -1566,7 +1564,7 @@
   /* Loop through all the null-terminated strings in the format
      argument.  Normally there's just one null-terminated string, but
      there can be arbitrarily many, concatenated together, if the
-     format contains '\0' bytes.  emacs_strftimeu stops at the first
+     format contains '\0' bytes.  nstrftime stops at the first
      '\0' byte so we must invoke it separately for each such string.  */
   for (;;)
     {
@@ -1576,7 +1574,7 @@
       if (s)
 	s[0] = '\1';
 
-      result = emacs_strftimeu (s, maxsize, format, tp, ut);
+      result = nstrftime (s, maxsize, format, tp, ut, 0);
 
       if (s)
 	{




^ permalink raw reply	[flat|nested] 47+ messages in thread

end of thread, other threads:[~2011-02-02 16:52 UTC | newest]

Thread overview: 47+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-30 23:43 gnulib strftime imported into Emacs Paul Eggert
2011-01-31  4:00 ` Eli Zaretskii
2011-01-31  8:02   ` Paul Eggert
2011-01-31  9:44     ` joakim
2011-01-31  9:59       ` Miles Bader
2011-01-31 10:16         ` joakim
2011-01-31 10:31           ` Miles Bader
2011-01-31 11:27       ` Eli Zaretskii
2011-01-31 11:06     ` Eli Zaretskii
2011-01-31 14:30       ` Tom Tromey
2011-01-31 14:43         ` Eli Zaretskii
2011-01-31 19:49           ` Eli Zaretskii
2011-01-31 22:19       ` Paul Eggert
2011-01-31 22:29         ` Lennart Borgman
2011-01-31 23:57           ` Paul Eggert
2011-02-01  0:15             ` Lennart Borgman
2011-02-01  0:24               ` Paul Eggert
2011-02-01  0:34                 ` Lennart Borgman
2011-02-01  4:05         ` Eli Zaretskii
2011-02-01  7:08           ` Paul Eggert
2011-02-01  8:58             ` Avoiding slowdown in trunk development (was: gnulib strftime imported into Emacs) Eli Zaretskii
2011-02-01 19:04               ` Avoiding slowdown in trunk development Paul Eggert
2011-02-01 19:54                 ` Lennart Borgman
2011-02-01 19:57                 ` Eli Zaretskii
2011-02-02 16:52                 ` Chong Yidong
2011-01-31 11:17     ` gnulib strftime imported into Emacs Lennart Borgman
2011-01-31 11:37       ` Eli Zaretskii
2011-01-31 11:52         ` Lennart Borgman
2011-01-31 13:01           ` Eli Zaretskii
2011-01-31 13:17             ` Andreas Schwab
2011-01-31 14:44               ` Eli Zaretskii
2011-01-31 14:54                 ` Andreas Schwab
2011-01-31 15:14                   ` Eli Zaretskii
2011-01-31 13:18             ` Lennart Borgman
2011-01-31 14:45             ` Eli Zaretskii
2011-01-31 19:50       ` Eli Zaretskii
2011-01-31 11:32     ` Andy Moreton
2011-01-31 19:53   ` Eli Zaretskii
2011-01-31 14:56 ` Eli Zaretskii
2011-01-31 16:56   ` Stefan Monnier
2011-01-31 20:06     ` Eli Zaretskii
2011-01-31 20:42       ` Stefan Monnier
2011-01-31 19:54 ` Eli Zaretskii
2011-01-31 23:25   ` Paul Eggert
2011-02-01  4:07     ` Eli Zaretskii
2011-02-01  6:25       ` Paul Eggert
2011-02-01  8:32         ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).