From c387a59e68cab9275ac782aa513176c57a0ff12f Mon Sep 17 00:00:00 2001 From: Raja R Harinath Date: Mon, 13 Jul 1998 06:45:26 +0000 Subject: [PATCH] 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 --- support/ChangeLog | 9 +++++++++ support/argp.h | 3 ++- support/gnomesupport.awk | 16 ++++++++++++++-- support/mkstemp.c | 5 +++++ 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 + + * 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 * argp-help.c: Don't include . 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 "; } - + if (!def["HAVE_SCANDIR"]) { print ""; print "#include "; @@ -42,7 +42,19 @@ END { if (def["HAVE_NDIR_H"]) print "#include "; } + } + 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 #include +#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. -- 2.7.4