Put c++ guards after #includes.
authorRaja R Harinath <harinath@src.gnome.org>
Thu, 27 May 1999 21:04:32 +0000 (21:04 +0000)
committerRaja R Harinath <harinath@src.gnome.org>
Thu, 27 May 1999 21:04:32 +0000 (21:04 +0000)
* 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
support/gnomesupport-fake.h
support/gnomesupport.awk

index b18c029..13a97c4 100644 (file)
@@ -1,3 +1,10 @@
+1999-05-27  Raja R Harinath  <harinath@cs.umn.edu>
+
+       * 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  <martin@home-of-linux.org>
 
        * canonicalize.c: Use `set_errno' instead of `__set_errno' and
index a6423d0..3431ce9 100644 (file)
 
 #include <gnomesupport.h>
 
-#include <gnome-argp.h>
+/* 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_ */
index 7e318b0..2f89ab6 100644 (file)
@@ -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 <stddef.h>           /* for size_t */";
 }
 
@@ -20,12 +16,10 @@ BEGIN {
 
 END {
   if (!def["HAVE_VASPRINTF"] || !def["HAVE_VSNPRINTF"]) {
-    print "";
     print "#include <stdarg.h>";
   }
 
   if (!def["HAVE_SCANDIR"] || def["NEED_DECLARATION_SCANDIR"]) {
-    print "";
     print "#include <sys/types.h>";
 
     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.  */";