Skip to content

Commit 9f4f3f1

Browse files
mdbmeskevinAlbs
authored andcommitted
CDRIVER-5889: Fix BSON_NORETURN for C23 standard (#1859)
* Fix C23 version of BSON_NORETURN macro definition
1 parent 4eedde9 commit 9f4f3f1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: src/libbson/src/bson/bson-macros.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@
200200

201201

202202
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
203-
#define BSON_NORETURN noreturn
203+
#define BSON_NORETURN [[noreturn]]
204204
#elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L
205205
#define BSON_NORETURN _Noreturn
206206
#elif defined(__GNUC__) && 2 < __GNUC__ + (8 <= __GNUC_MINOR__)
@@ -210,14 +210,14 @@
210210
#endif
211211

212212

213-
static BSON_INLINE BSON_NORETURN void
213+
BSON_NORETURN static BSON_INLINE void
214214
_bson_assert_failed_on_line (const char *file, int line, const char *func, const char *test)
215215
{
216216
fprintf (stderr, "%s:%d %s(): assertion failed: %s\n", file, line, func, test);
217217
abort ();
218218
}
219219

220-
static BSON_INLINE BSON_NORETURN void
220+
BSON_NORETURN static BSON_INLINE void
221221
_bson_assert_failed_on_param (const char *param, const char *func)
222222
{
223223
fprintf (stderr, "The parameter: %s, in function %s, cannot be NULL\n", param, func);

0 commit comments

Comments
 (0)