[gjs] gjs/native.h: Support Sun CC
- From: Colin Walters <walters src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs] gjs/native.h: Support Sun CC
- Date: Tue, 6 Nov 2012 17:56:57 +0000 (UTC)
commit 06c1aa9eb7f65c8e3cb57f579980a1b84ba961f3
Author: Erwann Chenede <erwann chenede sun com>
Date: Tue Nov 6 12:55:28 2012 -0500
gjs/native.h: Support Sun CC
Signed-off-by: Colin Walters <walters verbum org>
https://bugzilla.gnome.org/show_bug.cgi?id=619721
gjs/native.h | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/gjs/native.h b/gjs/native.h
index f30d763..80ee4c1 100644
--- a/gjs/native.h
+++ b/gjs/native.h
@@ -65,8 +65,18 @@ typedef enum {
typedef JSBool (* GjsDefineModuleFunc) (JSContext *context,
JSObject *module_obj);
+/* FIXME - Reuse glib/glib/gconstructor.h */
+#ifdef __GNUC__
+#define _GJS_CONSTRUCTOR __attribute__((constructor))
+#elif __SUNPRO_C
+#define Pragma(x) _Pragma(#x)
+#define _GJS_CONSTRUCTOR Pragma(init(register_native_module))
+#else
+Initialization routine in a dynamic object not defined for current compiler
+#endif
+
#define GJS_REGISTER_NATIVE_MODULE_WITH_FLAGS(module_id_string, module_func, flags) \
- __attribute__((constructor)) static void \
+ _GJS_CONSTRUCTOR static void \
register_native_module (void) \
{ \
gjs_register_native_module(module_id_string, module_func, flags); \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]