summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaja R Harinath <harinath@src.gnome.org>1998-07-29 20:37:19 +0000
committerRaja R Harinath <harinath@src.gnome.org>1998-07-29 20:37:19 +0000
commit1eb595d4d74d1bcbca53563e9cedebea9be2a99d (patch)
treef8b1a5813159406e0fb2c782dab2bb921f2f329c
parentdddcdc03b8d648b4fa7f54cb29ecf8865576352d (diff)
downloadgnome-common-1eb595d4d74d1bcbca53563e9cedebea9be2a99d.tar.gz
New file. Fake in HAVE_* for functions that are provided by `gnomesupport'
* gnomesupport-fake.h: New file. Fake in HAVE_* for functions that are provided by `gnomesupport' rather than `libc'. * error.c: Include gnomesupport-fake.h. (program_name): Define to `program_invocation_name' if HAVE_PROGRAM_INVOCATION_NAME. svn path=/trunk/; revision=305
-rw-r--r--support/ChangeLog8
-rw-r--r--support/error.c4
-rw-r--r--support/gnomesupport-fake.h22
3 files changed, 33 insertions, 1 deletions
diff --git a/support/ChangeLog b/support/ChangeLog
index 417e539..8fefff7 100644
--- a/support/ChangeLog
+++ b/support/ChangeLog
@@ -1,3 +1,11 @@
+1998-07-29 Raja R Harinath <harinath@cs.umn.edu>
+
+ * gnomesupport-fake.h: New file. Fake in HAVE_* for functions
+ that are provided by `gnomesupport' rather than `libc'.
+ * error.c: Include gnomesupport-fake.h.
+ (program_name): Define to `program_invocation_name' if
+ HAVE_PROGRAM_INVOCATION_NAME.
+
1998-07-29 Martin Baulig <martin@home-of-linux.org>
* error.c, error.h: New files. Imported from glibc.
diff --git a/support/error.c b/support/error.c
index 83998bb..2011c35 100644
--- a/support/error.c
+++ b/support/error.c
@@ -25,6 +25,8 @@
# include <config.h>
#endif
+#include <gnomesupport-fake.h>
+
#include <stdio.h>
#if HAVE_VPRINTF || HAVE_DOPRNT || _LIBC
@@ -65,7 +67,7 @@ void (*error_print_progname) (
/* This variable is incremented each time `error' is called. */
unsigned int error_message_count;
-#ifdef _LIBC
+#if defined _LIBC || HAVE_PROGRAM_INVOCATION_NAME
/* In the GNU C library, there is a predefined variable for this. */
# define program_name program_invocation_name
diff --git a/support/gnomesupport-fake.h b/support/gnomesupport-fake.h
new file mode 100644
index 0000000..067071e
--- /dev/null
+++ b/support/gnomesupport-fake.h
@@ -0,0 +1,22 @@
+#ifndef GNOMESUPPORT_FAKE_H_
+#define GNOMESUPPORT_FAKE_H_
+
+#if HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#include <gnomesupport.h>
+
+/* Override some of config.h.
+ Gnomesupport provides the replacements for these, so you actually
+ HAVE_ them. */
+
+#ifndef HAVE_STRERROR
+# define HAVE_STRERROR 1
+#endif
+
+#ifndef HAVE_PROGRAM_INVOCATION_NAME
+# define HAVE_PROGRAM_INVOCATION_NAME 1
+#endif
+
+#endif /* GNOMESUPPORT_FAKE_H_ */