summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9ecedde)
raw | patch | inline | side by side (parent: 9ecedde)
author | Fredrik Kuivinen <frekui@gmail.com> | |
Sun, 28 Aug 2011 20:08:46 +0000 (22:08 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 29 Aug 2011 05:03:26 +0000 (22:03 -0700) |
i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1, SunOS 5.10, and possibly
others do not have exit.h and exitfail.h. Remove the use of these in
obstack.c.
The __block variable was renamed to block to avoid a gcc error:
compat/obstack.h:190: error: __block attribute can be specified on variables only
Initial-patch-by: David Aguilar <davvid@gmail.com>
Reported-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Fredrik Kuivinen <frekui@gmail.com>
Acked-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
others do not have exit.h and exitfail.h. Remove the use of these in
obstack.c.
The __block variable was renamed to block to avoid a gcc error:
compat/obstack.h:190: error: __block attribute can be specified on variables only
Initial-patch-by: David Aguilar <davvid@gmail.com>
Reported-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Fredrik Kuivinen <frekui@gmail.com>
Acked-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/obstack.c | patch | blob | history | |
compat/obstack.h | patch | blob | history | |
kwset.c | patch | blob | history |
diff --git a/compat/obstack.c b/compat/obstack.c
index 75440d9c792f40f2d27208ffbe8217ccd842504b..a89ab5b8e88d5641f9e5cca5b3f9681d12069d39 100644 (file)
--- a/compat/obstack.c
+++ b/compat/obstack.c
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#ifdef _LIBC
-# include <obstack.h>
-# include <shlib-compat.h>
-#else
-# include "obstack.h"
-#endif
+#include "git-compat-util.h"
+#include <gettext.h>
+#include "obstack.h"
/* NOTE BEFORE MODIFYING THIS FILE: This version number must be
incremented whenever callers compiled using an old obstack.h can no
static void print_and_abort (void);
void (*obstack_alloc_failed_handler) (void) = print_and_abort;
-/* Exit value used when `print_and_abort' is used. */
-# include <stdlib.h>
-# ifdef _LIBC
-int obstack_exit_failure = EXIT_FAILURE;
-# else
-# include "exitfail.h"
-# define obstack_exit_failure exit_failure
-# endif
-
# ifdef _LIBC
# if SHLIB_COMPAT (libc, GLIBC_2_0, GLIBC_2_3_4)
/* A looong time ago (before 1994, anyway; we're not sure) this global variable
return nbytes;
}
\f
-/* Define the error handler. */
-# ifdef _LIBC
-# include <libintl.h>
-# else
-# include "gettext.h"
-# endif
-# ifndef _
-# define _(msgid) gettext (msgid)
-# endif
-
# ifdef _LIBC
# include <libio/iolibio.h>
# endif
# else
fprintf (stderr, "%s\n", _("memory exhausted"));
# endif
- exit (obstack_exit_failure);
+ exit (1);
}
#endif /* !ELIDE_CODE */
diff --git a/compat/obstack.h b/compat/obstack.h
index 449070e7f17e2a5671f25bc6955bde97af2e978d..d178bd67162fd2b566364ac6dff84cecdcaa9473 100644 (file)
--- a/compat/obstack.h
+++ b/compat/obstack.h
void (*) (void *, void *), void *);
extern int _obstack_memory_used (struct obstack *);
-void obstack_free (struct obstack *__obstack, void *__block);
+void obstack_free (struct obstack *, void *);
\f
/* Error handler called when `obstack_chunk_alloc' failed to allocate
should either abort gracefully or use longjump - but shouldn't
return. The default action is to print a message and abort. */
extern void (*obstack_alloc_failed_handler) (void);
-
-/* Exit value used when `print_and_abort' is used. */
-extern int obstack_exit_failure;
\f
/* Pointer to beginning of object being allocated or to be allocated next.
Note that this might not be the final address of the object