[gjs: 1/2] GjsPrivate: Sources should be C files



commit e1c96788d3e150d5b61496017f07b9519caabdff
Author: Philip Chimento <philip endlessm com>
Date:   Fri Jan 11 16:14:39 2019 -0800

    GjsPrivate: Sources should be C files
    
    The GjsPrivate library doesn't use any SpiderMonkey code, only C APIs.
    So the files should be compiled with a C compiler, otherwise we get
    C++'s stricter typechecks, making it hard to use void* APIs such as
    g_steal_pointer().
    
    [skip cpplint] - This shows a diff in the linter output because the
    files were renamed.

 configure.ac                                                  | 3 +++
 gjs-srcs.mk                                                   | 4 ++--
 libgjs-private/{gjs-gdbus-wrapper.cpp => gjs-gdbus-wrapper.c} | 2 +-
 libgjs-private/{gjs-util.cpp => gjs-util.c}                   | 0
 4 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 9ab365ed..14391d35 100644
--- a/configure.ac
+++ b/configure.ac
@@ -29,6 +29,9 @@ AM_SILENT_RULES([yes])
 PKG_PROG_PKG_CONFIG
 PKG_INSTALLDIR
 
+AC_PROG_CC
+AC_PROG_CC_C99
+
 AC_LANG([C++])
 AC_USE_SYSTEM_EXTENSIONS
 AC_PROG_CXX
diff --git a/gjs-srcs.mk b/gjs-srcs.mk
index bc2e8a22..dcdc4387 100644
--- a/gjs-srcs.mk
+++ b/gjs-srcs.mk
@@ -101,9 +101,9 @@ gjs_srcs =                          \
 
 # These files were part of a separate library
 gjs_private_srcs =                             \
-       libgjs-private/gjs-gdbus-wrapper.cpp    \
+       libgjs-private/gjs-gdbus-wrapper.c      \
        libgjs-private/gjs-gdbus-wrapper.h      \
-       libgjs-private/gjs-util.cpp             \
+       libgjs-private/gjs-util.c               \
        libgjs-private/gjs-util.h               \
        libgjs-private/gjs-gtk-util.h           \
        $(NULL)
diff --git a/libgjs-private/gjs-gdbus-wrapper.cpp b/libgjs-private/gjs-gdbus-wrapper.c
similarity index 99%
rename from libgjs-private/gjs-gdbus-wrapper.cpp
rename to libgjs-private/gjs-gdbus-wrapper.c
index e43d98c0..706ef7be 100644
--- a/libgjs-private/gjs-gdbus-wrapper.cpp
+++ b/libgjs-private/gjs-gdbus-wrapper.c
@@ -93,7 +93,7 @@ gjs_dbus_implementation_property_set(GDBusConnection       *connection,
 
     g_signal_emit(self, signals[SIGNAL_HANDLE_PROPERTY_SET], 0, property_name, value);
 
-    return true;
+    return TRUE;
 }
 
 static void
diff --git a/libgjs-private/gjs-util.cpp b/libgjs-private/gjs-util.c
similarity index 100%
rename from libgjs-private/gjs-util.cpp
rename to libgjs-private/gjs-util.c


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]