summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaja R Harinath <harinath@src.gnome.org>1998-07-13 06:45:26 +0000
committerRaja R Harinath <harinath@src.gnome.org>1998-07-13 06:45:26 +0000
commitc387a59e68cab9275ac782aa513176c57a0ff12f (patch)
treec50aab498e01e5018600a1e4a8b1c44846e191c2
parent5ba221b94ebcb1b4a47716437bc26a1e33923054 (diff)
downloadgnome-common-c387a59e68cab9275ac782aa513176c57a0ff12f.tar.gz
Define to `extern __inline__', rather that `extern inline'. Since this
* argp.h (ARGP_EI): Define to `extern __inline__', rather that `extern inline'. Since this code is inside an __OPTIMIZE__ check, I assume this is GCC, and __inline__ will work. * mkstemp.c: New file. * gnomesupport.awk: Conditionally emit prototype for `mkstemp'. svn path=/trunk/; revision=273
-rw-r--r--support/ChangeLog9
-rw-r--r--support/argp.h3
-rw-r--r--support/gnomesupport.awk16
-rw-r--r--support/mkstemp.c5
4 files changed, 30 insertions, 3 deletions
diff --git a/support/ChangeLog b/support/ChangeLog
index d4ff55b..3668574 100644
--- a/support/ChangeLog
+++ b/support/ChangeLog
@@ -1,3 +1,12 @@
+1998-07-13 Raja R Harinath <harinath@cs.umn.edu>
+
+ * argp.h (ARGP_EI): Define to `extern __inline__', rather that
+ `extern inline'. Since this code is inside an __OPTIMIZE__ check,
+ I assume this is GCC, and __inline__ will work.
+
+ * mkstemp.c: New file.
+ * gnomesupport.awk: Conditionally emit prototype for `mkstemp'.
+
Tue Jul 7 00:02:51 1998 Tom Tromey <tromey@cygnus.com>
* argp-help.c: Don't include <malloc.h>.
diff --git a/support/argp.h b/support/argp.h
index addb251..b27a02d 100644
--- a/support/argp.h
+++ b/support/argp.h
@@ -527,8 +527,9 @@ extern void *__argp_input __P ((__const struct argp *argp,
# define __option_is_end _option_is_end
# endif
+/* FIXME: Assume we are using GCC. This is inside an __OPTIMIZE__ test. */
# ifndef ARGP_EI
-# define ARGP_EI extern inline
+# define ARGP_EI extern __inline__
# endif
ARGP_EI void
diff --git a/support/gnomesupport.awk b/support/gnomesupport.awk
index 6767c41..96bec90 100644
--- a/support/gnomesupport.awk
+++ b/support/gnomesupport.awk
@@ -23,7 +23,7 @@ END {
print "";
print "#include <stdarg.h>";
}
-
+
if (!def["HAVE_SCANDIR"]) {
print "";
print "#include <sys/types.h>";
@@ -42,7 +42,19 @@ END {
if (def["HAVE_NDIR_H"])
print "#include <ndir.h>";
}
+ }
+ if (!def["HAVE_MKSTEMP"]) {
+ print "";
+ print "/* Generate a unique temporary file name from TEMPLATE.";
+ print " The last six characters of TEMPLATE must be "XXXXXX";";
+ print " they are replaced with a string that makes the filename";
+ print " unique. Returns a file descriptor open on the file for";
+ print " reading and writing. */";
+ print "int mkstemp (char */*template*/);";
+ }
+
+ if (!def["HAVE_SCANDIR"]) {
print "";
print "/* Scan the directory DIR, calling SELECTOR on each directory";
print " entry. Entries for which SELECTOR returns nonzero are";
@@ -112,7 +124,7 @@ END {
print " char */*fmt*/, ...);";
}
- print ""
+ print "";
print "#ifdef __cplusplus";
print "}";
print "#endif /* __cplusplus */";
diff --git a/support/mkstemp.c b/support/mkstemp.c
index f0db5d5..5744bc9 100644
--- a/support/mkstemp.c
+++ b/support/mkstemp.c
@@ -25,6 +25,11 @@
#include <unistd.h>
#include <sys/time.h>
+#ifndef _LIBC
+#define __gettimeofday gettimeofday
+#define __set_errno(e) errno = (e)
+#endif
+
/* Generate a unique temporary file name from TEMPLATE.
The last six characters of TEMPLATE must be "XXXXXX";
they are replaced with a string that makes the filename unique.