diff --git a/glib/glib-typeof.h b/glib/glib-typeof.h index c3519fa47..9b72bdb09 100644 --- a/glib/glib-typeof.h +++ b/glib/glib-typeof.h @@ -24,8 +24,6 @@ #error "Only can be included directly." #endif -#include - /* * We can only use __typeof__ on GCC >= 4.8, and not when compiling C++. Since * __typeof__ is used in a few places in GLib, provide a pre-processor symbol @@ -37,8 +35,7 @@ #if !G_CXX_STD_CHECK_VERSION (11) && \ (G_GNUC_CHECK_VERSION(4, 8) || defined(__clang__)) #define glib_typeof(t) __typeof__ (t) -#elif G_CXX_STD_CHECK_VERSION (11) && \ - GLIB_VERSION_MIN_REQUIRED >= GLIB_VERSION_2_68 +#elif G_CXX_STD_CHECK_VERSION (11) /* C++11 decltype() is close enough for our usage */ #include #define glib_typeof(t) typename std::remove_reference::type diff --git a/glib/glibconfig.h.in b/glib/glibconfig.h.in index c6f79b2cd..e0bcb3d1a 100644 --- a/glib/glibconfig.h.in +++ b/glib/glibconfig.h.in @@ -6,8 +6,6 @@ #ifndef __GLIBCONFIG_H__ #define __GLIBCONFIG_H__ -#include - #include #include #mesondefine GLIB_HAVE_ALLOCA_H @@ -26,7 +24,9 @@ */ #mesondefine GLIB_USING_SYSTEM_PRINTF -G_BEGIN_DECLS +#ifdef G_CXX_STD_VERSION +extern "C" { +#endif #define G_MINFLOAT FLT_MIN #define G_MAXFLOAT FLT_MAX @@ -215,6 +215,8 @@ typedef @g_pid_type@ GPid; #mesondefine G_HAVE_FREE_SIZED -G_END_DECLS +#ifdef G_CXX_STD_VERSION +} +#endif #endif /* __GLIBCONFIG_H__ */ diff --git a/glib/gmacros.h b/glib/gmacros.h index ed091c129..438c69fc3 100644 --- a/glib/gmacros.h +++ b/glib/gmacros.h @@ -940,6 +940,8 @@ #undef ABS #undef CLAMP +#include "glib-typeof.h" + #ifdef glib_typeof #define MAX(a, b) \