From 7cb04608d303797d3ba0aad728e571ae888d871e Mon Sep 17 00:00:00 2001 From: Raja R Harinath Date: Thu, 27 May 1999 21:04:32 +0000 Subject: [PATCH] Put c++ guards after #includes. * gnomesupport.awk: Put c++ guards after #includes. * gnomesupport-fake.h: Remove dependence on `gnome-argp.h'. Move relevant declarations here. svn path=/trunk/; revision=810 --- support/ChangeLog | 7 +++++++ support/gnomesupport-fake.h | 9 ++++++++- support/gnomesupport.awk | 11 +++++------ 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/support/ChangeLog b/support/ChangeLog index b18c029..13a97c4 100644 --- a/support/ChangeLog +++ b/support/ChangeLog @@ -1,3 +1,10 @@ +1999-05-27 Raja R Harinath + + * gnomesupport.awk: Put c++ guards after #includes. + + * gnomesupport-fake.h: Remove dependence on `gnome-argp.h'. Move + relevant declarations here. + 1999-05-12 Martin Baulig * canonicalize.c: Use `set_errno' instead of `__set_errno' and diff --git a/support/gnomesupport-fake.h b/support/gnomesupport-fake.h index a6423d0..3431ce9 100644 --- a/support/gnomesupport-fake.h +++ b/support/gnomesupport-fake.h @@ -11,7 +11,10 @@ #include -#include +/* Some systems, like Red Hat 4.0, define these but don't declare + them. Hopefully it is safe to always declare them here. */ +extern char *program_invocation_short_name; +extern char *program_invocation_name; /* Override some of config.h. Gnomesupport provides the replacements for these, so you actually @@ -25,4 +28,8 @@ # define HAVE_PROGRAM_INVOCATION_NAME 1 #endif +#ifndef HAVE_PROGRAM_INVOCATION_SHORT_NAME +# define HAVE_PROGRAM_INVOCATION_SHORT_NAME 1 +#endif + #endif /* GNOMESUPPORT_FAKE_H_ */ diff --git a/support/gnomesupport.awk b/support/gnomesupport.awk index 7e318b0..2f89ab6 100644 --- a/support/gnomesupport.awk +++ b/support/gnomesupport.awk @@ -8,10 +8,6 @@ BEGIN { print "#ifndef GNOMESUPPORT_H"; print "#define GNOMESUPPORT_H"; print ""; - print "#ifdef __cplusplus"; - print "extern \"C\" {"; - print "#endif /* __cplusplus */"; - print ""; print "#include /* for size_t */"; } @@ -20,12 +16,10 @@ BEGIN { END { if (!def["HAVE_VASPRINTF"] || !def["HAVE_VSNPRINTF"]) { - print ""; print "#include "; } if (!def["HAVE_SCANDIR"] || def["NEED_DECLARATION_SCANDIR"]) { - print ""; print "#include "; if (def["HAVE_DIRENT_H"]) { @@ -44,6 +38,11 @@ END { } } + print ""; + print "#ifdef __cplusplus"; + print "extern \"C\" {"; + print "#endif /* __cplusplus */"; + if (def["NEED_DECLARATION_GETHOSTNAME"]) { print ""; print "/* Get name of current host. */"; -- 2.7.4