mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-05-25 06:50:40 +02:00
Try to fix things
glib_typeof wasn't defined in gmacros.h, so we never used the better macros :(
This commit is contained in:
parent
1d9c85185e
commit
ff8cd60bfc
@ -24,8 +24,6 @@
|
||||
#error "Only <glib.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <glib/gversionmacros.h>
|
||||
|
||||
/*
|
||||
* 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 <type_traits>
|
||||
#define glib_typeof(t) typename std::remove_reference<decltype (t)>::type
|
||||
|
@ -6,8 +6,6 @@
|
||||
#ifndef __GLIBCONFIG_H__
|
||||
#define __GLIBCONFIG_H__
|
||||
|
||||
#include <glib/gmacros.h>
|
||||
|
||||
#include <limits.h>
|
||||
#include <float.h>
|
||||
#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__ */
|
||||
|
@ -940,6 +940,8 @@
|
||||
#undef ABS
|
||||
#undef CLAMP
|
||||
|
||||
#include "glib-typeof.h"
|
||||
|
||||
#ifdef glib_typeof
|
||||
|
||||
#define MAX(a, b) \
|
||||
|
Loading…
x
Reference in New Issue
Block a user