summaryrefslogtreecommitdiff
path: root/navit/support
diff options
context:
space:
mode:
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2011-01-24 15:52:48 +0000
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2011-01-24 15:52:48 +0000
commit504d9b85f9bb88083dbdc9651ff856f60c3e7828 (patch)
tree6ff014b2867af21f58ddba3d4ee32e3ec65bc31a /navit/support
parent2db10372450a2975b2c95cf5a76047ba2dcb60a1 (diff)
downloadnavit-504d9b85f9bb88083dbdc9651ff856f60c3e7828.tar.gz
Add:support_glib:g_alloca support|Thanks chollya
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@3970 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/support')
-rw-r--r--navit/support/glib/fake.h6
-rw-r--r--navit/support/glib/galloca.h63
-rw-r--r--navit/support/glib/glib.h1
3 files changed, 67 insertions, 3 deletions
diff --git a/navit/support/glib/fake.h b/navit/support/glib/fake.h
index d46f16eeb..44e79b912 100644
--- a/navit/support/glib/fake.h
+++ b/navit/support/glib/fake.h
@@ -35,9 +35,9 @@
#endif
-#define G_LOCK_DEFINE_STATIC(name) void
-#define G_LOCK(name) void //g_mutex_lock (&G_LOCK_NAME (name))
-#define G_UNLOCK(name) void //g_mutex_unlock (&G_LOCK_NAME (name))
+#define G_LOCK_DEFINE_STATIC(name) //void
+#define G_LOCK(name) //void //g_mutex_lock (&G_LOCK_NAME (name))
+#define G_UNLOCK(name) //void //g_mutex_unlock (&G_LOCK_NAME (name))
#define g_thread_supported() TRUE
diff --git a/navit/support/glib/galloca.h b/navit/support/glib/galloca.h
new file mode 100644
index 000000000..356587ff6
--- /dev/null
+++ b/navit/support/glib/galloca.h
@@ -0,0 +1,63 @@
+/* GLIB - Library of useful routines for C programming
+ * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ * Boston, MA 02111-1307, USA.
+ */
+
+/*
+ * Modified by the GLib Team and others 1997-2000. See the AUTHORS
+ * file for a list of people on the GLib Team. See the ChangeLog
+ * files for a list of changes. These files are distributed with
+ * GLib at ftp://ftp.gtk.org/pub/gtk/.
+ */
+
+#if defined(G_DISABLE_SINGLE_INCLUDES) && !defined (__GLIB_H_INSIDE__) && !defined (GLIB_COMPILATION)
+#error "Only <glib.h> can be included directly."
+#endif
+
+#ifndef __G_ALLOCA_H__
+#define __G_ALLOCA_H__
+
+#include <glib/gtypes.h>
+
+#ifdef __GNUC__
+/* GCC does the right thing */
+# undef alloca
+# define alloca(size) __builtin_alloca (size)
+#elif defined (GLIB_HAVE_ALLOCA_H)
+/* a native and working alloca.h is there */
+# include <alloca.h>
+#else /* !__GNUC__ && !GLIB_HAVE_ALLOCA_H */
+# if defined(_MSC_VER) || defined(__DMC__)
+# include <malloc.h>
+# define alloca _alloca
+# else /* !_MSC_VER && !__DMC__ */
+# ifdef _AIX
+# pragma alloca
+# else /* !_AIX */
+# ifndef alloca /* predefined by HP cc +Olibcalls */
+G_BEGIN_DECLS
+char *alloca ();
+G_END_DECLS
+# endif /* !alloca */
+# endif /* !_AIX */
+# endif /* !_MSC_VER && !__DMC__ */
+#endif /* !__GNUC__ && !GLIB_HAVE_ALLOCA_H */
+
+#define g_alloca(size) alloca (size)
+#define g_newa(struct_type, n_structs) ((struct_type*) g_alloca (sizeof (struct_type) * (gsize) (n_structs)))
+
+#endif /* __G_ALLOCA_H__ */
diff --git a/navit/support/glib/glib.h b/navit/support/glib/glib.h
index 8f98575b3..cd8644521 100644
--- a/navit/support/glib/glib.h
+++ b/navit/support/glib/glib.h
@@ -28,6 +28,7 @@
#define __G_LIB_H__
#define __GLIB_H_INSIDE__
+#include <glib/galloca.h>
#include <glib/gerror.h>
#include <glib/fake.h>
#include <glib/ghash.h>