0003-remove-cpp-requirement.patch 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. From 2f168951df1feebeac549ada1ea44ea092484c54 Mon Sep 17 00:00:00 2001
  2. From: Adam Duskett <Aduskett@gmail.com>
  3. Date: Mon, 16 Sep 2019 10:12:38 -0700
  4. Subject: [PATCH] remove cpp requirement
  5. The c++ test is necessary to ensure libglib doesn't accidentally use C++
  6. reserved keywords in public headers. Because this is just a test, it isn't
  7. necessary to have a C++ compiler to build libglib2.
  8. Signed-off-by: Adam Duskett <Aduskett@gmail.com>
  9. Upstream status: Denied (Buildroot specific)
  10. https://gitlab.gnome.org/GNOME/glib/issues/1748
  11. ---
  12. glib/glibconfig.h.in | 1 -
  13. meson.build | 18 +-----------------
  14. tests/meson.build | 5 -----
  15. 3 files changed, 1 insertion(+), 23 deletions(-)
  16. diff --git a/glib/glibconfig.h.in b/glib/glibconfig.h.in
  17. index 7ef8c48..128e65d 100644
  18. --- a/glib/glibconfig.h.in
  19. +++ b/glib/glibconfig.h.in
  20. @@ -117,7 +117,6 @@ typedef unsigned @glib_intptr_type_define@ guintptr;
  21. @glib_vacopy@
  22. @g_have_iso_c_varargs@
  23. -@g_have_iso_cxx_varargs@
  24. /* gcc-2.95.x supports both gnu style and ISO varargs, but if -ansi
  25. * is passed ISO vararg support is turned off, and there is no work
  26. diff --git a/meson.build b/meson.build
  27. index 4bbf4c2..ac59f4e 100644
  28. --- a/meson.build
  29. +++ b/meson.build
  30. @@ -1,4 +1,4 @@
  31. -project('glib', 'c', 'cpp',
  32. +project('glib', 'c',
  33. version : '2.64.4',
  34. # NOTE: We keep this pinned at 0.49 because that's what Debian 10 ships
  35. meson_version : '>= 0.49.2',
  36. @@ -10,7 +10,6 @@ project('glib', 'c', 'cpp',
  37. )
  38. cc = meson.get_compiler('c')
  39. -cxx = meson.get_compiler('cpp')
  40. cc_can_run = not meson.is_cross_build() or meson.has_exe_wrapper()
  41. @@ -1548,20 +1547,6 @@ if g_have_iso_c_varargs
  42. #endif''')
  43. endif
  44. -g_have_iso_cxx_varargs = cxx.compiles('''
  45. - void some_func (void) {
  46. - int a(int p1, int p2, int p3);
  47. - #define call_a(...) a(1,__VA_ARGS__)
  48. - call_a(2,3);
  49. - }''', name : 'ISO C99 varargs macros in C++')
  50. -
  51. -if g_have_iso_cxx_varargs
  52. - glibconfig_conf.set('g_have_iso_cxx_varargs', '''
  53. -#ifdef __cplusplus
  54. -# define G_HAVE_ISO_VARARGS 1
  55. -#endif''')
  56. -endif
  57. -
  58. g_have_gnuc_varargs = cc.compiles('''
  59. void some_func (void) {
  60. int a(int p1, int p2, int p3);
  61. @@ -2167,7 +2152,6 @@ subdir('gobject')
  62. subdir('gthread')
  63. subdir('gmodule')
  64. subdir('gio')
  65. -subdir('fuzzing')
  66. if build_tests
  67. subdir('tests')
  68. endif
  69. diff --git a/tests/meson.build b/tests/meson.build
  70. index e4ea226..7fd974c 100644
  71. --- a/tests/meson.build
  72. +++ b/tests/meson.build
  73. @@ -55,11 +55,6 @@ tests = {
  74. 'source': 'module-test.c',
  75. 'c_args': ['-DMODULE_TYPE="plugin"'],
  76. },
  77. - 'cxx-test' : {
  78. - 'source' : 'cxx-test.cpp',
  79. - 'include_directories' : gmoduleinc,
  80. - 'dependencies' : [libgio_dep],
  81. - },
  82. }
  83. test_extra_programs = {
  84. --
  85. 2.23.0