v10-0002-Use-typeof-everywhere-instead-of-compiler-specif.patch
text/x-patch
Filename: v10-0002-Use-typeof-everywhere-instead-of-compiler-specif.patch
Type: text/x-patch
Part: 1
Message:
Re: Make copyObject work in C++
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: format-patch
Series: patch v10-0002
Subject: Use typeof everywhere instead of compiler specific spellings
| File | + | − |
|---|---|---|
| src/include/c.h | 4 | 4 |
From c8fd6666836c7696c49708e1afb785cad3b55f13 Mon Sep 17 00:00:00 2001 From: Jelte Fennema-Nio <postgres@jeltef.nl> Date: Mon, 8 Dec 2025 08:13:51 +0100 Subject: [PATCH v10 2/4] Use typeof everywhere instead of compiler specific spellings We define typeof ourselves as __typeof__ if it does not exist. So let's actually use that for consistency. The meson/autoconf checks for __builtin_types_compatible_p still use __typeof__ though, because there we have not redefined it. --- src/include/c.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/include/c.h b/src/include/c.h index a4fee84398d..df01acdf6ba 100644 --- a/src/include/c.h +++ b/src/include/c.h @@ -1008,10 +1008,10 @@ pg_noreturn extern void ExceptionalCondition(const char *conditionName, */ #ifdef HAVE__BUILTIN_TYPES_COMPATIBLE_P #define StaticAssertVariableIsOfType(varname, typename) \ - StaticAssertDecl(__builtin_types_compatible_p(__typeof__(varname), typename), \ + StaticAssertDecl(__builtin_types_compatible_p(typeof(varname), typename), \ CppAsString(varname) " does not have type " CppAsString(typename)) #define StaticAssertVariableIsOfTypeMacro(varname, typename) \ - (StaticAssertExpr(__builtin_types_compatible_p(__typeof__(varname), typename), \ + (StaticAssertExpr(__builtin_types_compatible_p(typeof(varname), typename), \ CppAsString(varname) " does not have type " CppAsString(typename))) #else /* !HAVE__BUILTIN_TYPES_COMPATIBLE_P */ #define StaticAssertVariableIsOfType(varname, typename) \ @@ -1275,11 +1275,11 @@ typedef struct PGAlignedXLogBlock PGAlignedXLogBlock; #define unvolatize(underlying_type, expr) const_cast<underlying_type>(expr) #elif defined(HAVE__BUILTIN_TYPES_COMPATIBLE_P) #define unconstify(underlying_type, expr) \ - (StaticAssertExpr(__builtin_types_compatible_p(__typeof(expr), const underlying_type), \ + (StaticAssertExpr(__builtin_types_compatible_p(typeof(expr), const underlying_type), \ "wrong cast"), \ (underlying_type) (expr)) #define unvolatize(underlying_type, expr) \ - (StaticAssertExpr(__builtin_types_compatible_p(__typeof(expr), volatile underlying_type), \ + (StaticAssertExpr(__builtin_types_compatible_p(typeof(expr), volatile underlying_type), \ "wrong cast"), \ (underlying_type) (expr)) #else -- 2.53.0