Changeset: 0294eefd400f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/0294eefd400f
Modified Files:
clients/mapiclient/msqldump.c
monetdb_config.h.in
tools/merovingian/client/monetdb.c
tools/mserver/mserver5.c
Branch: default
Log Message:
Some code rearrangements in monetdb_config.h.
Also, no need to have a separate declaration just to add a _Noreturn.
diffs (truncated from 412 to 300 lines):
diff --git a/clients/mapiclient/msqldump.c b/clients/mapiclient/msqldump.c
--- a/clients/mapiclient/msqldump.c
+++ b/clients/mapiclient/msqldump.c
@@ -24,9 +24,7 @@
#include "mutils.h" /* mercurial_revision */
#include "dotmonetdb.h"
-static _Noreturn void usage(const char *prog, int xit);
-
-static void
+static _Noreturn void
usage(const char *prog, int xit)
{
fprintf(stderr, "Usage: %s [ options ] [ dbname ]\n", prog);
diff --git a/monetdb_config.h.in b/monetdb_config.h.in
--- a/monetdb_config.h.in
+++ b/monetdb_config.h.in
@@ -113,6 +113,10 @@
#define countof(X) (sizeof(X) / sizeof((X)[0]))
#endif
+#ifdef HAVE_STRINGS_H
+#include <strings.h> /* strcasecmp */
+#endif
+
#ifdef _MSC_VER
/* Windows include files */
@@ -128,6 +132,169 @@
#endif /* _MSC_VER */
+/* compiler features */
+
+#ifndef _Noreturn
+#ifdef __cplusplus
+#define _Noreturn
+#else
+#cmakedefine _Noreturn @_Noreturn@
+#endif
+#endif
+/* Does your compiler support `inline' keyword? (C99 feature) */
+#ifndef inline
+#ifdef __cplusplus
+#define inline
+#else
+#cmakedefine inline @inline@
+#endif
+#endif
+/* Does your compiler support `restrict' keyword? (C99 feature) */
+#ifndef restrict
+#ifdef __cplusplus
+#define restrict
+#else
+#cmakedefine restrict @restrict@
+#endif
+#endif
+
+#if !defined(__cplusplus) || __cplusplus < 201103L
+#ifndef static_assert
+/* static_assert is a C11/C++11 feature, defined in assert.h which also
+ * exists in many other compilers. We ignore it if the compiler doesn't
+ * support it. In C11 static_assert is a macro, while in C++11 it is a
+ * keyword */
+#define static_assert(expr, mesg) ((void) 0)
+#endif
+#endif
+
+/* Does your compiler support `__attribute__' extension? */
+#if defined(__has_attribute)
+/* if __has_attribute is known, use it to find out whether specific
+ * attributes that we use are known */
+#if __has_attribute(__access__)
+#define ATTR_ACCESS(...) __attribute__((__access__(__VA_ARGS__)))
+#endif
+#if __has_attribute(__aligned__)
+#define ATTR_ALIGNED(...)
__attribute__((__aligned__(__VA_ARGS__)))
+#endif
+#if __has_attribute(__alloc_size__)
+#define ATTR_ALLOC_SIZE(...) __attribute__((__alloc_size__(__VA_ARGS__)))
+#endif
+#if __has_attribute(__cold__)
+#define ATTR_COLD __attribute__((__cold__))
+#endif
+#if __has_attribute(__const__)
+#define ATTR_CONST __attribute__((__const__))
+#endif
+#if __has_attribute(__constructor__)
+#define ATTR_CONSTRUCTOR __attribute__((__constructor__))
+#endif
+#if __has_attribute(__counted_by__)
+#define ATTR_COUNTED_BY(...) __attribute__((__counted_by__(__VA_ARGS__)))
+#endif
+#if __has_attribute(__designated_init__)
+#define ATTR_DESIGNATED_INIT __attribute__((__designated_init__))
+#endif
+#if __has_attribute(__format__)
+#define ATTR_FORMAT(...) __attribute__((__format__(__VA_ARGS__)))
+#endif
+#if __has_attribute(__malloc__)
+#define ATTR_MALLOC __attribute__((__malloc__))
+#if defined(__GNUC__) && __GNUC__ >= 13
+/* attribute malloc with argument seems to have been introduced in gcc 13 */
+#define ATTR_MALLOC_ARGS(...) __attribute__(( __malloc__(__VA_ARGS__)))
+#endif
+#endif
+#if __has_attribute(__noinline__)
+#define ATTR_NOINLINE __attribute__((__noinline__))
+#endif
+#if __has_attribute(__nonnull__)
+#define ATTR_NONNULL(...)
__attribute__((__nonnull__(__VA_ARGS__)))
+#endif
+#if __has_attribute(__nonnull_if_nonzero__)
+#define ATTR_NONNULL_IF_NONZERO(...)
__attribute__((__nonnull_if_nonzero__(__VA_ARGS__)))
+#endif
+#if __has_attribute(__nonstring__)
+#define ATTR_NONSTRING __attribute__((__nonstring__))
+#endif
+#if __has_attribute(__pure__)
+#define ATTR_PURE __attribute__((__pure__))
+#endif
+#if __has_attribute(__returns_nonnull__)
+#define ATTR_RETURNS_NONNULL __attribute__((__returns_nonnull__))
+#endif
+#if __has_attribute(__sentinel__)
+#define ATTR_SENTINEL __attribute__((__sentinel__))
+#endif
+#if __has_attribute(__visibility__)
+#if !defined(__CYGWIN__)
+#define ATTR_VISIBILITY_HIDDEN __attribute__((__visibility__("hidden")))
+#endif
+#endif
+#if __has_attribute(__warn_unused_result__)
+#define ATTR_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__))
+#endif
+#endif
+
+#ifndef ATTR_ACCESS
+#define ATTR_ACCESS(...)
+#endif
+#ifndef ATTR_ALIGNED
+#define ATTR_ALIGNED(...)
+#endif
+#ifndef ATTR_ALLOC_SIZE
+#define ATTR_ALLOC_SIZE(...)
+#endif
+#ifndef ATTR_COLD
+#define ATTR_COLD
+#endif
+#ifndef ATTR_CONST
+#define ATTR_CONST
+#endif
+#ifndef ATTR_COUNTED_BY
+#define ATTR_COUNTED_BY(...)
+#endif
+#ifndef ATTR_DESIGNATED_INIT
+#define ATTR_DESIGNATED_INIT
+#endif
+#ifndef ATTR_FORMAT
+#define ATTR_FORMAT(...)
+#endif
+#ifndef ATTR_MALLOC
+#define ATTR_MALLOC
+#endif
+#ifndef ATTR_MALLOC_ARGS
+#define ATTR_MALLOC_ARGS(...)
+#endif
+#ifndef ATTR_NOINLINE
+#define ATTR_NOINLINE
+#endif
+#ifndef ATTR_NONNULL
+#define ATTR_NONNULL(...)
+#endif
+#ifndef ATTR_NONNULL_IF_NONZERO
+#define ATTR_NONNULL_IF_NONZERO(...)
+#endif
+#ifndef ATTR_NONSTRING
+#define ATTR_NONSTRING
+#endif
+#ifndef ATTR_PURE
+#define ATTR_PURE
+#endif
+#ifndef ATTR_RETURNS_NONNULL
+#define ATTR_RETURNS_NONNULL
+#endif
+#ifndef ATTR_SENTINEL
+#define ATTR_SENTINEL
+#endif
+#ifndef ATTR_VISIBILITY_HIDDEN
+#define ATTR_VISIBILITY_HIDDEN
+#endif
+#ifndef ATTR_WARN_UNUSED_RESULT
+#define ATTR_WARN_UNUSED_RESULT
+#endif
+
// functions that may or may not be available
#cmakedefine HAVE_ACCEPT4 1
#cmakedefine HAVE_ASCTIME_R 1
@@ -289,30 +456,6 @@
/* The used password hash algorithm */
#define MONETDB5_PASSWDHASH_TOKEN @PASSWORD_BACKEND@
-#ifndef _Noreturn
-#ifdef __cplusplus
-#define _Noreturn
-#else
-#cmakedefine _Noreturn @_Noreturn@
-#endif
-#endif
-/* Does your compiler support `inline' keyword? (C99 feature) */
-#ifndef inline
-#ifdef __cplusplus
-#define inline
-#else
-#cmakedefine inline @inline@
-#endif
-#endif
-/* Does your compiler support `restrict' keyword? (C99 feature) */
-#ifndef restrict
-#ifdef __cplusplus
-#define restrict
-#else
-#cmakedefine restrict @restrict@
-#endif
-#endif
-
// End Section: monetdb configure misc
// Section: monetdb configure sizes
@@ -376,146 +519,6 @@ typedef __uint128_t uint128_t;
// End Section: monetdb configure sizes
-/* Does your compiler support `__attribute__' extension? */
-#if defined(__has_attribute)
-/* if __has_attribute is known, use it to find out whether specific
- * attributes that we use are known */
-#if __has_attribute(__access__)
-#define ATTR_ACCESS(...) __attribute__((__access__(__VA_ARGS__)))
-#endif
-#if __has_attribute(__aligned__)
-#define ATTR_ALIGNED(...)
__attribute__((__aligned__(__VA_ARGS__)))
-#endif
-#if __has_attribute(__alloc_size__)
-#define ATTR_ALLOC_SIZE(...) __attribute__((__alloc_size__(__VA_ARGS__)))
-#endif
-#if __has_attribute(__cold__)
-#define ATTR_COLD __attribute__((__cold__))
-#endif
-#if __has_attribute(__const__)
-#define ATTR_CONST __attribute__((__const__))
-#endif
-#if __has_attribute(__constructor__)
-#define ATTR_CONSTRUCTOR __attribute__((__constructor__))
-#endif
-#if __has_attribute(__counted_by__)
-#define ATTR_COUNTED_BY(...) __attribute__((__counted_by__(__VA_ARGS__)))
-#endif
-#if __has_attribute(__designated_init__)
-#define ATTR_DESIGNATED_INIT __attribute__((__designated_init__))
-#endif
-#if __has_attribute(__format__)
-#define ATTR_FORMAT(...) __attribute__((__format__(__VA_ARGS__)))
-#endif
-#if __has_attribute(__malloc__)
-#define ATTR_MALLOC __attribute__((__malloc__))
-#if defined(__GNUC__) && __GNUC__ >= 13
-/* attribute malloc with argument seems to have been introduced in gcc 13 */
-#define ATTR_MALLOC_ARGS(...) __attribute__(( __malloc__(__VA_ARGS__)))
-#endif
-#endif
-#if __has_attribute(__noinline__)
-#define ATTR_NOINLINE __attribute__((__noinline__))
-#endif
-#if __has_attribute(__nonnull__)
-#define ATTR_NONNULL(...)
__attribute__((__nonnull__(__VA_ARGS__)))
-#endif
-#if __has_attribute(__nonnull_if_nonzero__)
-#define ATTR_NONNULL_IF_NONZERO(...)
__attribute__((__nonnull_if_nonzero__(__VA_ARGS__)))
-#endif
-#if __has_attribute(__nonstring__)
-#define ATTR_NONSTRING __attribute__((__nonstring__))
-#endif
-#if __has_attribute(__pure__)
-#define ATTR_PURE __attribute__((__pure__))
-#endif
-#if __has_attribute(__returns_nonnull__)
-#define ATTR_RETURNS_NONNULL __attribute__((__returns_nonnull__))
-#endif
-#if __has_attribute(__sentinel__)
-#define ATTR_SENTINEL __attribute__((__sentinel__))
-#endif
-#if __has_attribute(__visibility__)
-#if !defined(__CYGWIN__)
-#define ATTR_VISIBILITY_HIDDEN __attribute__((__visibility__("hidden")))
-#endif
-#endif
-#if __has_attribute(__warn_unused_result__)
-#define ATTR_WARN_UNUSED_RESULT __attribute__((__warn_unused_result__))
-#endif
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]