]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Portability to SunOS 4, which lacks atexit().
authorBruno Haible <bruno@clisp.org>
Tue, 23 Sep 2003 10:14:26 +0000 (10:14 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:11:01 +0000 (12:11 +0200)
gettext-tools/ChangeLog
gettext-tools/configure.ac
gettext-tools/lib/ChangeLog
gettext-tools/lib/Makefile.am
gettext-tools/lib/atexit.c [new file with mode: 0644]

index 9ed08e3cc41497cae36f8d2ade09118df5bc3002..6be53021c76d836b697e3ebdf5bc3a87cde33383 100644 (file)
@@ -1,3 +1,8 @@
+2003-09-16  Bruno Haible  <bruno@clisp.org>
+
+       Portability to SunOS 4.
+       * configure.ac: Also check for atexit.
+
 2003-09-14  Bruno Haible  <bruno@clisp.org>
 
        * windows/gettextlib.def: Export fwriteerror.
index 97c1c9c7b5f2f7abd9c1c932aad8752475031541..f7c44a1fccbfad17a7941dbb5360cf1998e435f6 100644 (file)
@@ -103,7 +103,7 @@ gl_FUNC_ALLOCA
 AC_FUNC_VPRINTF
 AC_CHECK_FUNCS([chown getcwd posix_spawn raise select strerror strtoul uname \
 utime utimes])
-AC_REPLACE_FUNCS([memmove memset stpcpy strcspn \
+AC_REPLACE_FUNCS([atexit memmove memset stpcpy strcspn \
 strcasecmp strncasecmp strpbrk strstr vasprintf])
 AM_FUNC_GETLINE
 if test $am_cv_func_working_getline != yes; then
index bd837290d2542588f7e2f3becf5e2e4da80a04cb..fce03c96f0894da32f7d57b7e6be488046405d16 100644 (file)
@@ -1,3 +1,9 @@
+2003-09-16  Bruno Haible  <bruno@clisp.org>
+
+       Portability to SunOS 4.
+       * atexit.c: New file, from gnulib with modifications.
+       * Makefile.am (LIBADD_SOURCE): Add atexit.c.
+
 2003-09-14  Bruno Haible  <bruno@clisp.org>
 
        * closeout.c: Include fwriteerror.h.
index b6addbb808e15538eef240d436a8a3c86adcc2c3..bbdd05935b81998caf93f4f1a3a8b4f907c2329c 100644 (file)
@@ -78,6 +78,7 @@ libgettextlib_la_SOURCES = \
 
 LIBADD_SOURCE = \
   alloca.c \
+  atexit.c \
   canonicalize.h canonicalize.c \
   fnmatch.c \
   getline.h getline.c \
diff --git a/gettext-tools/lib/atexit.c b/gettext-tools/lib/atexit.c
new file mode 100644 (file)
index 0000000..fdc7b43
--- /dev/null
@@ -0,0 +1,15 @@
+/* Wrapper to implement ANSI C's atexit using SunOS's on_exit. */
+/* This function is in the public domain.  --Mike Stump. */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+int
+atexit (void (*f)())
+{
+  /* If the system doesn't provide a definition for atexit, use on_exit
+     if the system provides that.  */
+  on_exit (f, 0);
+  return 0;
+}