Fix possible clash of config headers
Both GLib and GStreamer have a config file called `config.h` and use the `HAVE_CONFIG_H` macro to conditionally include them.
Normally, this works out fine, but if they are subprojects, we may accidentally trigger including a different `config.h`. This is normally harmless, but it causes a bunch of warnings because we define `GETTEXT_PACKAGE` on the command-line, and it won't match the one in a different project.
However, we only include this file in source files, not headers, and it's always created, so there's no need to conditionally include it or define the macro. We can also rename it so it can't clash with other instances as well.
Testing Done:
Compiled with subprojects and stopped seeing many warnings about `GETTEXT_PACKAGE` and other generic variables being re-defined due to GStreamer's `config.h`.
Reviewed at https://reviews.imfreedom.org/r/2707/
--- a/finch/finchnotifications.c Wed Oct 25 18:56:35 2023 -0500
+++ b/finch/finchnotifications.c Wed Oct 25 20:26:35 2023 -0500
@@ -20,7 +20,7 @@
* along with this program; if not, see <https://www.gnu.org/licenses/>.
+#include <purpleconfig.h> #include <glib/gi18n-lib.h>
--- a/finch/gntconv.c Wed Oct 25 18:56:35 2023 -0500
+++ b/finch/gntconv.c Wed Oct 25 20:26:35 2023 -0500
@@ -20,6 +20,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
+#include "purpleconfig.h" @@ -46,8 +48,6 @@
#define PREF_CHAT PREF_ROOT "/chats"
#define PREF_USERLIST PREF_CHAT "/userlist"
static void generate_send_to_menu(FinchConv *ggc);
static int color_message_receive;
--- a/finch/gntdebug.c Wed Oct 25 18:56:35 2023 -0500
+++ b/finch/gntdebug.c Wed Oct 25 20:26:35 2023 -0500
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
+#include <purpleconfig.h> #include <glib/gi18n-lib.h>
--- a/finch/gntmedia.c Wed Oct 25 18:56:35 2023 -0500
+++ b/finch/gntmedia.c Wed Oct 25 20:26:35 2023 -0500
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
+#include <purpleconfig.h> #include <glib/gi18n-lib.h>
--- a/finch/libfinch.c Wed Oct 25 18:56:35 2023 -0500
+++ b/finch/libfinch.c Wed Oct 25 20:26:35 2023 -0500
@@ -20,6 +20,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
+#include "purpleconfig.h" @@ -36,7 +38,6 @@
#include "package_revision.h"
--- a/finch/plugins/gntclipboard/gntclipboard.c Wed Oct 25 18:56:35 2023 -0500
+++ b/finch/plugins/gntclipboard/gntclipboard.c Wed Oct 25 20:26:35 2023 -0500
@@ -18,9 +18,7 @@
#define _POSIX_C_SOURCE 200809L /* Needed to get kill(2). */
-#endif /* HAVE_CONFIG_H */
+#include <purpleconfig.h> #include <glib/gi18n-lib.h>
--- a/libpurple/core.c Wed Oct 25 18:56:35 2023 -0500
+++ b/libpurple/core.c Wed Oct 25 20:26:35 2023 -0500
@@ -19,14 +19,12 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
+#include <purpleconfig.h> #include <glib/gi18n-lib.h>
#define G_SETTINGS_ENABLE_BACKEND
#include <gio/gsettingsbackend.h>
-#endif /* HAVE_CONFIG_H */
#include "conversations.h"
--- a/libpurple/plugins.c Wed Oct 25 18:56:35 2023 -0500
+++ b/libpurple/plugins.c Wed Oct 25 20:26:35 2023 -0500
@@ -20,11 +20,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
-#include <glib/gi18n-lib.h>
+#include <purpleconfig.h>
-#endif /* HAVE_CONFIG_H */
+#include <glib/gi18n-lib.h> --- a/libpurple/plugins/notification-sound/notification-sound.c Wed Oct 25 18:56:35 2023 -0500
+++ b/libpurple/plugins/notification-sound/notification-sound.c Wed Oct 25 20:26:35 2023 -0500
@@ -19,7 +19,7 @@
* along with this program; if not, see <https://www.gnu.org/licenses/>.
+#include <purpleconfig.h> #include <glib/gi18n-lib.h>
--- a/libpurple/prefs.c Wed Oct 25 18:56:35 2023 -0500
+++ b/libpurple/prefs.c Wed Oct 25 20:26:35 2023 -0500
@@ -21,9 +21,7 @@
-#endif /* HAVE_CONFIG_H */
+#include <purpleconfig.h> --- a/libpurple/protocols/bonjour/bonjour_ft.c Wed Oct 25 18:56:35 2023 -0500
+++ b/libpurple/protocols/bonjour/bonjour_ft.c Wed Oct 25 20:26:35 2023 -0500
@@ -20,7 +20,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#include <purpleconfig.h> --- a/libpurple/protocols/jabber/jabber.c Wed Oct 25 18:56:35 2023 -0500
+++ b/libpurple/protocols/jabber/jabber.c Wed Oct 25 20:26:35 2023 -0500
@@ -21,7 +21,7 @@
+#include <purpleconfig.h> --- a/libpurple/protocols/jabber/jabber.h Wed Oct 25 18:56:35 2023 -0500
+++ b/libpurple/protocols/jabber/jabber.h Wed Oct 25 20:26:35 2023 -0500
@@ -57,8 +57,6 @@
#include <libsoup/soup.h>
--- a/libpurple/protocols/jabber/jingle/rtp.c Wed Oct 25 18:56:35 2023 -0500
+++ b/libpurple/protocols/jabber/jingle/rtp.c Wed Oct 25 20:26:35 2023 -0500
@@ -22,7 +22,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
+#include <purpleconfig.h> #include <glib/gi18n-lib.h>
--- a/libpurple/protocols/jabber/jingle/rtp.h Wed Oct 25 18:56:35 2023 -0500
+++ b/libpurple/protocols/jabber/jingle/rtp.h Wed Oct 25 20:26:35 2023 -0500
@@ -25,8 +25,6 @@
#ifndef PURPLE_JABBER_JINGLE_RTP_H
#define PURPLE_JABBER_JINGLE_RTP_H
--- a/libpurple/protocols/jabber/si.c Wed Oct 25 18:56:35 2023 -0500
+++ b/libpurple/protocols/jabber/si.c Wed Oct 25 20:26:35 2023 -0500
@@ -22,7 +22,7 @@
+#include <purpleconfig.h> --- a/libpurple/protocols/jabber/useravatar.c Wed Oct 25 18:56:35 2023 -0500
+++ b/libpurple/protocols/jabber/useravatar.c Wed Oct 25 20:26:35 2023 -0500
@@ -21,7 +21,7 @@
+#include <purpleconfig.h> #include <glib/gi18n-lib.h>
--- a/libpurple/protocols/jabber/xmpp.c Wed Oct 25 18:56:35 2023 -0500
+++ b/libpurple/protocols/jabber/xmpp.c Wed Oct 25 20:26:35 2023 -0500
@@ -20,7 +20,7 @@
+#include <purpleconfig.h> #include <glib/gi18n-lib.h>
--- a/libpurple/util.c Wed Oct 25 18:56:35 2023 -0500
+++ b/libpurple/util.c Wed Oct 25 20:26:35 2023 -0500
@@ -17,9 +17,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
-#endif /* HAVE_CONFIG_H */
+#include <purpleconfig.h> #include <glib/gi18n-lib.h>
--- a/libpurple/win32/libc_interface.c Wed Oct 25 18:56:35 2023 -0500
+++ b/libpurple/win32/libc_interface.c Wed Oct 25 20:26:35 2023 -0500
@@ -19,7 +19,7 @@
+#include <purpleconfig.h> #include <glib/gi18n-lib.h>
--- a/libpurple/win32/win32dep.c Wed Oct 25 18:56:35 2023 -0500
+++ b/libpurple/win32/win32dep.c Wed Oct 25 20:26:35 2023 -0500
@@ -22,6 +22,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
+#include "purpleconfig.h" #include "win32/win32dep.h"
--- a/libpurple/win32/win32dep.h Wed Oct 25 18:56:35 2023 -0500
+++ b/libpurple/win32/win32dep.h Wed Oct 25 20:26:35 2023 -0500
@@ -23,8 +23,6 @@
#ifndef PURPLE_WIN32_WIN32DEP_H
#define PURPLE_WIN32_WIN32DEP_H
--- a/meson.build Wed Oct 25 18:56:35 2023 -0500
+++ b/meson.build Wed Oct 25 20:26:35 2023 -0500
@@ -43,7 +43,6 @@
'-DVERSION="@0@"'.format(meson.project_version()),
'-DDISPLAY_VERSION="@0@"'.format(meson.project_version()),
'-DPURPLE_WEBSITE="https://pidgin.im/"',
@@ -192,7 +191,6 @@
enable_introspection = false
-conf.set('ENABLE_INTROSPECTION', enable_introspection)
#######################################################################
# Check Pidgin dependencies
@@ -406,7 +404,6 @@
'-DDISPLAY_VERSION="@0@"'.format(meson.project_version()),
'-DPURPLE_WEBSITE="https://pidgin.im/"',
f'-DGETTEXT_PACKAGE="@GETTEXT_PACKAGE@"'],
@@ -465,7 +462,7 @@
conf.set('DEBUG', enable_debug)
-# So that config.h may be found.
+# So that purpleconfig.h may be found. toplevel_inc = include_directories('.')
@@ -475,8 +472,7 @@
-configure_file(output : 'config.h',
+configure_file(output: 'purpleconfig.h', configuration: conf) config_home = get_option('devenv-config-dir')
--- a/pidgin/gtkblist.c Wed Oct 25 18:56:35 2023 -0500
+++ b/pidgin/gtkblist.c Wed Oct 25 20:26:35 2023 -0500
@@ -19,9 +19,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
+#include <purpleconfig.h> #include <glib/gi18n-lib.h>
--- a/pidgin/gtkconv.c Wed Oct 25 18:56:35 2023 -0500
+++ b/pidgin/gtkconv.c Wed Oct 25 20:26:35 2023 -0500
@@ -20,9 +20,7 @@
+#include <purpleconfig.h> #include <glib/gi18n-lib.h>
--- a/pidgin/gtkdialogs.c Wed Oct 25 18:56:35 2023 -0500
+++ b/pidgin/gtkdialogs.c Wed Oct 25 20:26:35 2023 -0500
@@ -19,9 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
+#include <purpleconfig.h> #include <glib/gi18n-lib.h>
--- a/pidgin/gtkidle.c Wed Oct 25 18:56:35 2023 -0500
+++ b/pidgin/gtkidle.c Wed Oct 25 20:26:35 2023 -0500
@@ -16,9 +16,7 @@
* along with this program; if not, see <https://www.gnu.org/licenses/>.
+#include <purpleconfig.h> --- a/pidgin/gtkmedia.c Wed Oct 25 18:56:35 2023 -0500
+++ b/pidgin/gtkmedia.c Wed Oct 25 20:26:35 2023 -0500
@@ -19,9 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
+#include <purpleconfig.h> #include <glib/gi18n-lib.h>
--- a/pidgin/gtkutils.c Wed Oct 25 18:56:35 2023 -0500
+++ b/pidgin/gtkutils.c Wed Oct 25 20:26:35 2023 -0500
@@ -19,9 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
+#include <purpleconfig.h> --- a/pidgin/libpidgin.c Wed Oct 25 18:56:35 2023 -0500
+++ b/pidgin/libpidgin.c Wed Oct 25 20:26:35 2023 -0500
@@ -20,9 +20,7 @@
* along with this program; if not, see <https://www.gnu.org/licenses/>.
+#include <purpleconfig.h> #include <glib/gi18n-lib.h>
--- a/pidgin/pidginabout.c Wed Oct 25 18:56:35 2023 -0500
+++ b/pidgin/pidginabout.c Wed Oct 25 20:26:35 2023 -0500
@@ -20,9 +20,7 @@
* along with this program; if not, see <https://www.gnu.org/licenses/>.
+#include <purpleconfig.h> #include "meson-config.h"
--- a/pidgin/pidginapplication.c Wed Oct 25 18:56:35 2023 -0500
+++ b/pidgin/pidginapplication.c Wed Oct 25 20:26:35 2023 -0500
@@ -20,9 +20,7 @@
* along with this program; if not, see <https://www.gnu.org/licenses/>.
+#include <purpleconfig.h> #include <glib/gi18n-lib.h>
--- a/pidgin/pidgindebug.c Wed Oct 25 18:56:35 2023 -0500
+++ b/pidgin/pidgindebug.c Wed Oct 25 20:26:35 2023 -0500
@@ -19,9 +19,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
+#include <purpleconfig.h> #include <glib/gi18n-lib.h>
--- a/pidgin/pidginui.c Wed Oct 25 18:56:35 2023 -0500
+++ b/pidgin/pidginui.c Wed Oct 25 20:26:35 2023 -0500
@@ -26,9 +26,7 @@
#define G_SETTINGS_ENABLE_BACKEND
#include <gio/gsettingsbackend.h>
+#include <purpleconfig.h> --- a/pidgin/plugins/disco/gtkdisco.c Wed Oct 25 18:56:35 2023 -0500
+++ b/pidgin/plugins/disco/gtkdisco.c Wed Oct 25 20:26:35 2023 -0500
@@ -20,9 +20,7 @@
* along with this program; if not, see <https://www.gnu.org/licenses/>.
+#include <purpleconfig.h> #include <glib/gi18n-lib.h>
--- a/pidgin/plugins/gestures/stroke-draw.c Wed Oct 25 18:56:35 2023 -0500
+++ b/pidgin/plugins/gestures/stroke-draw.c Wed Oct 25 20:26:35 2023 -0500
@@ -4,7 +4,7 @@
See the file COPYING for distribution information.
+#include "purpleconfig.h" --- a/pidgin/plugins/gestures/stroke.c Wed Oct 25 18:56:35 2023 -0500
+++ b/pidgin/plugins/gestures/stroke.c Wed Oct 25 20:26:35 2023 -0500
@@ -7,7 +7,7 @@
This file contains the stroke recognition algorithm.
+#include "purpleconfig.h" --- a/pidgin/prefs/pidginprefs.c Wed Oct 25 18:56:35 2023 -0500
+++ b/pidgin/prefs/pidginprefs.c Wed Oct 25 20:26:35 2023 -0500
@@ -20,9 +20,7 @@
* along with this program; if not, see <https://www.gnu.org/licenses/>.
+#include <purpleconfig.h> --- a/pidgin/prefs/pidginvvprefs.c Wed Oct 25 18:56:35 2023 -0500
+++ b/pidgin/prefs/pidginvvprefs.c Wed Oct 25 20:26:35 2023 -0500
@@ -20,9 +20,7 @@
* along with this program; if not, see <https://www.gnu.org/licenses/>.
+#include <purpleconfig.h> --- a/pidgin/win32/gtkwin32dep.h Wed Oct 25 18:56:35 2023 -0500
+++ b/pidgin/win32/gtkwin32dep.h Wed Oct 25 20:26:35 2023 -0500
@@ -20,8 +20,6 @@
--- a/pidgin/win32/winpidgin.c Wed Oct 25 18:56:35 2023 -0500
+++ b/pidgin/win32/winpidgin.c Wed Oct 25 20:26:35 2023 -0500
@@ -30,7 +30,7 @@
* at runtime if needed and dynamically loads libpidgin via LoadLibrary().
+#include "purpleconfig.h"