summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/c.h45
-rw-r--r--src/include/mb/pg_wchar.h2
-rw-r--r--src/include/pg_config.h.in6
-rw-r--r--src/include/storage/dsm_registry.h4
-rw-r--r--src/include/utils/inval.h3
-rw-r--r--src/include/utils/pg_locale.h6
6 files changed, 19 insertions, 47 deletions
diff --git a/src/include/c.h b/src/include/c.h
index d2cdc76644c..811d6d0110c 100644
--- a/src/include/c.h
+++ b/src/include/c.h
@@ -923,52 +923,31 @@ pg_noreturn extern void ExceptionalCondition(const char *conditionName,
* If the "condition" (a compile-time-constant expression) evaluates to false,
* throw a compile error using the "errmessage" (a string literal).
*
- * C11 has _Static_assert(), and most C99 compilers already support that. For
- * portability, we wrap it into StaticAssertDecl(). _Static_assert() is a
- * "declaration", and so it must be placed where for example a variable
+ * We require C11 and C++11, so static_assert() is expected to be there.
+ * StaticAssertDecl() was previously used for portability, but it's now just a
+ * plain wrapper and doesn't need to be used in new code. static_assert() is
+ * a "declaration", and so it must be placed where for example a variable
* declaration would be valid. As long as we compile with
* -Wno-declaration-after-statement, that also means it cannot be placed after
* statements in a function. Macros StaticAssertStmt() and StaticAssertExpr()
* make it safe to use as a statement or in an expression, respectively.
*
- * For compilers without _Static_assert(), we fall back on a kluge that
- * assumes the compiler will complain about a negative width for a struct
+ * For compilers without GCC statement expressions, we fall back on a kluge
+ * that assumes the compiler will complain about a negative width for a struct
* bit-field. This will not include a helpful error message, but it beats not
* getting an error at all.
*/
-#ifndef __cplusplus
-#ifdef HAVE__STATIC_ASSERT
-#define StaticAssertDecl(condition, errmessage) \
- _Static_assert(condition, errmessage)
-#define StaticAssertStmt(condition, errmessage) \
- do { _Static_assert(condition, errmessage); } while(0)
-#define StaticAssertExpr(condition, errmessage) \
- ((void) ({ StaticAssertStmt(condition, errmessage); true; }))
-#else /* !HAVE__STATIC_ASSERT */
-#define StaticAssertDecl(condition, errmessage) \
- extern void static_assert_func(int static_assert_failure[(condition) ? 1 : -1])
-#define StaticAssertStmt(condition, errmessage) \
- ((void) sizeof(struct { int static_assert_failure : (condition) ? 1 : -1; }))
-#define StaticAssertExpr(condition, errmessage) \
- StaticAssertStmt(condition, errmessage)
-#endif /* HAVE__STATIC_ASSERT */
-#else /* C++ */
-#if defined(__cpp_static_assert) && __cpp_static_assert >= 200410
#define StaticAssertDecl(condition, errmessage) \
static_assert(condition, errmessage)
#define StaticAssertStmt(condition, errmessage) \
- static_assert(condition, errmessage)
+ do { static_assert(condition, errmessage); } while(0)
+#ifdef HAVE_STATEMENT_EXPRESSIONS
#define StaticAssertExpr(condition, errmessage) \
- ({ static_assert(condition, errmessage); })
-#else /* !__cpp_static_assert */
-#define StaticAssertDecl(condition, errmessage) \
- extern void static_assert_func(int static_assert_failure[(condition) ? 1 : -1])
-#define StaticAssertStmt(condition, errmessage) \
- do { struct static_assert_struct { int static_assert_failure : (condition) ? 1 : -1; }; } while(0)
+ ((void) ({ static_assert(condition, errmessage); true; }))
+#else
#define StaticAssertExpr(condition, errmessage) \
- ((void) ({ StaticAssertStmt(condition, errmessage); }))
-#endif /* __cpp_static_assert */
-#endif /* C++ */
+ ((void) sizeof(struct { int static_assert_failure : (condition) ? 1 : -1; }))
+#endif /* HAVE_STATEMENT_EXPRESSIONS */
/*
diff --git a/src/include/mb/pg_wchar.h b/src/include/mb/pg_wchar.h
index 4d84bdc81e4..5df67ceea87 100644
--- a/src/include/mb/pg_wchar.h
+++ b/src/include/mb/pg_wchar.h
@@ -676,8 +676,6 @@ extern int pg_valid_server_encoding(const char *name);
extern bool is_encoding_supported_by_icu(int encoding);
extern const char *get_encoding_name_for_icu(int encoding);
-extern unsigned char *unicode_to_utf8(char32_t c, unsigned char *utf8string);
-extern char32_t utf8_to_unicode(const unsigned char *c);
extern bool pg_utf8_islegal(const unsigned char *source, int length);
extern int pg_utf_mblen(const unsigned char *s);
extern int pg_mule_mblen(const unsigned char *s);
diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in
index 3a7edb1f0a0..92fcc5f3063 100644
--- a/src/include/pg_config.h.in
+++ b/src/include/pg_config.h.in
@@ -385,6 +385,9 @@
/* Define to 1 if you have the `SSL_CTX_set_num_tickets' function. */
#undef HAVE_SSL_CTX_SET_NUM_TICKETS
+/* Define to 1 if your compiler supports statement expressions. */
+#undef HAVE_STATEMENT_EXPRESSIONS
+
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
@@ -565,9 +568,6 @@
/* Define to 1 if you have __get_cpuid_count. */
#undef HAVE__GET_CPUID_COUNT
-/* Define to 1 if your compiler understands _Static_assert. */
-#undef HAVE__STATIC_ASSERT
-
/* Define as the maximum alignment requirement of any C data type. */
#undef MAXIMUM_ALIGNOF
diff --git a/src/include/storage/dsm_registry.h b/src/include/storage/dsm_registry.h
index 4871ed509eb..c7c6827afec 100644
--- a/src/include/storage/dsm_registry.h
+++ b/src/include/storage/dsm_registry.h
@@ -16,8 +16,8 @@
#include "lib/dshash.h"
extern void *GetNamedDSMSegment(const char *name, size_t size,
- void (*init_callback) (void *ptr),
- bool *found);
+ void (*init_callback) (void *ptr, void *arg),
+ bool *found, void *arg);
extern dsa_area *GetNamedDSA(const char *name, bool *found);
extern dshash_table *GetNamedDSHash(const char *name,
const dshash_parameters *params,
diff --git a/src/include/utils/inval.h b/src/include/utils/inval.h
index af466252578..345733dd038 100644
--- a/src/include/utils/inval.h
+++ b/src/include/utils/inval.h
@@ -61,8 +61,7 @@ extern void CacheInvalidateHeapTuple(Relation relation,
HeapTuple tuple,
HeapTuple newtuple);
extern void CacheInvalidateHeapTupleInplace(Relation relation,
- HeapTuple tuple,
- HeapTuple newtuple);
+ HeapTuple key_equivalent_tuple);
extern void CacheInvalidateCatalog(Oid catalogId);
diff --git a/src/include/utils/pg_locale.h b/src/include/utils/pg_locale.h
index 832007385d8..6cf1985963d 100644
--- a/src/include/utils/pg_locale.h
+++ b/src/include/utils/pg_locale.h
@@ -38,7 +38,7 @@
* https://www.unicode.org/versions/Unicode16.0.0/core-spec/chapter-5/#G29675
*/
#define UNICODE_CASEMAP_LEN 3
-#define UNICODE_CASEMAP_BUFSZ (UNICODE_CASEMAP_LEN * sizeof(char32_t))
+#define UNICODE_CASEMAP_BUFSZ (UNICODE_CASEMAP_LEN * MAX_MULTIBYTE_CHAR_LEN)
/* GUC settings */
extern PGDLLIMPORT char *locale_messages;
@@ -125,9 +125,6 @@ struct ctype_methods
bool (*wc_iscased) (pg_wchar wc, pg_locale_t locale);
pg_wchar (*wc_toupper) (pg_wchar wc, pg_locale_t locale);
pg_wchar (*wc_tolower) (pg_wchar wc, pg_locale_t locale);
-
- /* required */
- bool (*char_is_cased) (char ch, pg_locale_t locale);
};
/*
@@ -178,7 +175,6 @@ extern pg_locale_t pg_newlocale_from_collation(Oid collid);
extern char *get_collation_actual_version(char collprovider, const char *collcollate);
-extern bool char_is_cased(char ch, pg_locale_t locale);
extern size_t pg_strlower(char *dst, size_t dstsize,
const char *src, ssize_t srclen,
pg_locale_t locale);