Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sLrbD-00Gyv4-6y for pgsql-hackers@arkaria.postgresql.org; Mon, 24 Jun 2024 21:51:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sLrbB-00CDLH-Ar for pgsql-hackers@arkaria.postgresql.org; Mon, 24 Jun 2024 21:51:41 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1sLrbA-00CDL8-U4 for pgsql-hackers@lists.postgresql.org; Mon, 24 Jun 2024 21:51:41 +0000 Received: from mail-pg1-x530.google.com ([2607:f8b0:4864:20::530]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sLrb8-002x0P-4z for pgsql-hackers@lists.postgresql.org; Mon, 24 Jun 2024 21:51:39 +0000 Received: by mail-pg1-x530.google.com with SMTP id 41be03b00d2f7-71816f36d4dso2070510a12.2 for ; Mon, 24 Jun 2024 14:51:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719265896; x=1719870696; darn=lists.postgresql.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=xl9JWXCawj7wFNs0c/0ZvVcqLH0yyaz1MWBmDNsFNWE=; b=CGK34R7lNxRz+JaRartl1/+LJCqmPdi7QTzl0taEh81GSScAHqole+2t9yxmLgVT3d NqyM4aVlsMjo8fc6OJt/1vmjmuREhPCcsQULsIRdqkUx80IHbLZPJTrSxdAsLTPfiH/7 FuFxiDAJQnzFd88pRwTkbVDU2xk90vd1uWQDnO5vnjheuNDpCkPhcJ4T04jXaLXvKVKo EWRBZ6LhkYfVPlYaxpIHz8aaO31zQ27+8dVDqAqn58+V1Ep01DL9qn5VNFMnYN5rS7jn CIZS03XWcpI8Nb4BQ1vlJyIo2gyrstVqThQo7mlQVFlzUraRmSSwg3vzK+F+NLwo4BVx nqIg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719265896; x=1719870696; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=xl9JWXCawj7wFNs0c/0ZvVcqLH0yyaz1MWBmDNsFNWE=; b=a2646Ul5CFqG7d3Rj7ADTt6KypEyuOS/bguoN06d7kmukzjSjQxDNA5Yq7OO+ALJUP Si/Nk8qGqK1Opg+Swlj5f9N9rACsZk4/03F+nbuMQHTU93nNVsJwQSjuoDm7qyPQfpYF j3zRaM8DKIAG48LS1anTNlHegLbAftBjqPBemtMHEoWYuzTOBCtUb6RLDbJUk8asFfNi lY1jF0EAmb/kanYHGeR9dF3PZFjeI8GXEd1iJOpBud7xfHefhbwq+2kNDQHyqCMLX79k QtZYmaIJImHeq0bJBo84BTTZtwY4CMe3WheIVY/gSLbz/Y3db/RtELSnTO+rtBzcCCb7 XpVw== X-Gm-Message-State: AOJu0YxhhOnlYtpENdVShwftUED3SESaNe2Oj693Axcoz2uAcItqOt6L Dz+VVFdIEHNB+Rvy3Vj7agwH7wZk6/gq99a0l3qoMfjz5SBG+3INcTODKQ== X-Google-Smtp-Source: AGHT+IHxKQalFF+PTsn5p3+hJJtl5v0YCZ2C2gTG8tvgfLQeXgH3m+sVUy3DOAonvkwYb6XBYC7Tkg== X-Received: by 2002:a17:90b:180b:b0:2c8:716f:b47f with SMTP id 98e67ed59e1d1-2c8716fbb29mr4481682a91.14.1719265896437; Mon, 24 Jun 2024 14:51:36 -0700 (PDT) Received: from localhost.localdomain (192-184-144-144.fiber.dynamic.sonic.net. [192.184.144.144]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2c819a8e633sm7282964a91.28.2024.06.24.14.51.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 24 Jun 2024 14:51:36 -0700 (PDT) From: Stan Hu To: pgsql-hackers@lists.postgresql.org Cc: Stan Hu Subject: [PATCH] Fix type redefinition build errors with macOS SDK 15.0 Date: Mon, 24 Jun 2024 14:51:07 -0700 Message-ID: <4edd2d3c30429c4445cc805ae9a788c489856eb7.1719265762.git.stanhu@gmail.com> X-Mailer: git-send-email 2.45.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Prior to macOS SDK 15, there were include guards in $SDK_ROOT/usr/include/xlocale/_regex.h: #ifndef _REGEX_H_ #include <_regex.h> #endif // _REGEX_H_ #include <_xlocale.h> In macOS SDK 15.5, these include guards are gone: #include <_regex.h> #include <_xlocale.h> Because _REGEX_H_ was defined locally in PostgreSQL's version of src/include/regex/regex.h, these include guards prevented duplicate definitions from $SDK_ROOT/usr/include/_regex.h (not to be confused with $SDK_ROOT/usr/include/xlocale/_regex.h). To fix this build issue, define __REGEX_H_ to prevent macOS from including the header that contain redefinitions of the local regex structures. Discussion: https://www.postgresql.org/message-id/CAMBWrQ%3DF9SSPfsFtCv%3DJT51WGK2VcgLA%2BiiJJOmjN0zbbufOEA%40mail.gmail.com --- src/include/regex/regex.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/include/regex/regex.h b/src/include/regex/regex.h index d08113724f..045ac626cc 100644 --- a/src/include/regex/regex.h +++ b/src/include/regex/regex.h @@ -32,6 +32,20 @@ * src/include/regex/regex.h */ +#if defined(__darwin__) +/* + * mmacOS SDK 15.0 removed the _REGEX_H_ include guards in + * $SDK_ROOT/usr/include/xlocale/_regex.h, so now + * $SDK_ROOT/usr/include/_regex.h is always included. That file defines + * the same types as below. To guard against type redefinition errors, + * define __REGEX_H_. + */ +#ifndef __REGEX_H_ +#define __REGEX_H_ + +#endif /* __REGEX_H_ */ +#endif + /* * Add your own defines, if needed, here. */ -- 2.45.0