Changeset: 425e9732f3d0 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/425e9732f3d0
Modified Files:
        gdk/gdk.h
Branch: ustr
Log Message:

Merge with default branch.


diffs (truncated from 445 to 300 lines):

diff --git a/common/stream/stream.h b/common/stream/stream.h
--- a/common/stream/stream.h
+++ b/common/stream/stream.h
@@ -23,6 +23,8 @@
  * required for proper conversion on different byte order platforms.
  */
 
+#include "monetdb_config.h"
+
 #include <unistd.h>
 #include <ctype.h>
 #include <stdio.h>
@@ -47,21 +49,6 @@
 # define stream_export extern
 #endif
 
-/* Does your compiler support `__attribute__' extension? */
-#if !defined(__has_attribute)
-#ifndef __attribute__
-#define __attribute__(...)
-#endif
-#endif
-
-/* Defines to help the compiler check printf-style format arguments.
- * These defines are also in our config.h, but we repeat them here so
- * that we don't need that for this file.*/
-#if !defined(_MSC_VER) && !defined(_In_z_)
-# define _In_z_
-# define _Printf_format_string_
-#endif
-
 #define EOT 4
 
 /* fwf gets turned into a csv with these parameters */
diff --git a/common/utils/matomic.h b/common/utils/matomic.h
--- a/common/utils/matomic.h
+++ b/common/utils/matomic.h
@@ -53,6 +53,8 @@
 #ifndef _MATOMIC_H_
 #define _MATOMIC_H_
 
+#include "monetdb_config.h"
+
 /* the atomic type we export is always a 64 bit unsigned integer */
 
 /* ignore __STDC_NO_ATOMICS__ if compiling using Intel compiler on
diff --git a/common/utils/mstring.h b/common/utils/mstring.h
--- a/common/utils/mstring.h
+++ b/common/utils/mstring.h
@@ -11,6 +11,8 @@
 #ifndef _MSTRING_H_
 #define _MSTRING_H_
 
+#include "monetdb_config.h"
+
 #include <string.h>
 
 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 
4))
@@ -20,30 +22,6 @@
 #define GCC_Pragma(pragma)
 #endif
 
-/* if __has_attribute is not known to the preprocessor, we ignore
- * attributes completely (see monetdb_config.h); if it is known, use it
- * to find out whether specific attributes that we use are known */
-#if defined(__has_attribute)
-#if !__has_attribute(__access__)
-#define __access__(...)
-#endif
-#if !__has_attribute(__format__)
-#define __format__(...)
-#endif
-#if !__has_attribute(__nonnull__)
-#define __nonnull__(...)
-#endif
-#if !__has_attribute(__nonnull_if_nonzero__)
-#define __nonnull_if_nonzero__(...)
-#endif
-#if !__has_attribute(__pure__)
-#define __pure__
-#endif
-#if !__has_attribute(__sentinel__)
-#define __sentinel__
-#endif
-#endif
-
 #ifndef mutils_export
 #if defined(_MSC_VER) || defined(__CYGWIN__) || defined(__MINGW32__)
 #ifndef LIBMUTILS
diff --git a/gdk/CMakeLists.txt b/gdk/CMakeLists.txt
--- a/gdk/CMakeLists.txt
+++ b/gdk/CMakeLists.txt
@@ -42,7 +42,6 @@ target_sources(bat
   PRIVATE
   gdk_select.c
   gdk_calc_compare_eq.c gdk_calc_compare_ne.c
-  gdk_calc.c gdk_calc.h
   gdk_calc_addsub.c gdk_calc_mul.c gdk_calc_div.c gdk_calc_mod.c 
gdk_calc_convert.c
   gdk_calc_compare_lt.c gdk_calc_compare_gt.c
   gdk_calc_compare_le.c gdk_calc_compare_ge.c
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -23,6 +23,23 @@
 
 #include "monetdb_config.h"
 
+/* standard C-99 include files */
+#include <assert.h>
+#include <ctype.h>
+#include <errno.h>
+#include <float.h>
+#include <inttypes.h>
+#include <limits.h>
+#include <setjmp.h>
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stddef.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <time.h>
+
 /* standard includes upon which all configure tests depend */
 #ifdef HAVE_SYS_STAT_H
 # include <sys/stat.h>
@@ -39,6 +56,10 @@
 # include <dirent.h>
 #endif
 
+#include "stream.h"
+#include "mstring.h"
+#include "matomic.h"
+
 #ifndef PATH_MAX
 #define PATH_MAX       1024
 #endif
@@ -53,6 +74,20 @@
 #define gdk_export extern
 #endif
 
+/* unreachable code */
+#ifdef __has_builtin
+#if __has_builtin(__builtin_unreachable)
+#define MT_UNREACHABLE()       do { assert(0); __builtin_unreachable(); } 
while (0)
+#endif
+#endif
+#ifndef MT_UNREACHABLE
+#if defined(_MSC_VER)
+#define MT_UNREACHABLE()       do { assert(0); __assume(0); } while (0)
+#else
+#define MT_UNREACHABLE()       do { assert(0); GDKfatal("Unreachable C code 
path reached"); } while (0)
+#endif
+#endif
+
 /* Only ever compare with GDK_SUCCEED, never with GDK_FAIL, and do not
  * use as a Boolean. */
 typedef enum gdk_return { GDK_FAIL, GDK_SUCCEED } gdk_return;
@@ -81,10 +116,9 @@ typedef struct allocator_state {
        allocator *ma;
 } allocator_state;
 
+#include "gdk_tracer.h"
 #include "gdk_system.h"
 #include "gdk_posix.h"
-#include "stream.h"
-#include "mstring.h"
 
 gdk_export _Noreturn void GDKfatal(_In_z_ _Printf_format_string_ const char 
*format, ...)
        __attribute__((__format__(__printf__, 1, 2)));
@@ -235,6 +269,14 @@ gdk_export size_t blobsize(size_t nitems
  * integers */
 #endif
 
+/* The types `oid`, `BUN` and `var_t` are all defined as `size_t`, but
+ * they serve different purposes.  `oid` is the *logical* row number of
+ * a BAT; `BUN` is the *physical* row number of a BAT and is therefore
+ * also used for the total number of rows and the potential capacity of
+ * a BAT; `var_t` is an *offset* into the var-size heap (vheap).  The
+ * difference between the *logical* and *physical* row number is the
+ * value of the head sequence base (`hseqbase`) of the BAT. */
+
 typedef oid var_t;             /* type used for heap index of var-sized BAT */
 #define SIZEOF_VAR_T   SIZEOF_OID
 #define VARFMT         OIDFMT
@@ -1226,10 +1268,6 @@ BATnegateprops(BAT *b)
 #define GDKERROR       "!ERROR: "
 #define GDKFATAL       "!FATAL: "
 
-/* Data Distilleries uses ICU for internationalization of some MonetDB error 
messages */
-
-#include "gdk_tracer.h"
-
 gdk_export gdk_return GDKtracer_fill_comp_info(BAT *id, BAT *component, BAT 
*log_level);
 
 #define GDKerror(...)          TRC_ERROR(GDK, __VA_ARGS__)
diff --git a/gdk/gdk_system.h b/gdk/gdk_system.h
--- a/gdk/gdk_system.h
+++ b/gdk/gdk_system.h
@@ -11,87 +11,6 @@
 #ifndef _GDK_SYSTEM_H_
 #define _GDK_SYSTEM_H_
 
-/* if __has_attribute is not known to the preprocessor, we ignore
- * attributes completely (see monetdb_config.h); if it is known, use it
- * to find out whether specific attributes that we use are known */
-#if defined(__has_attribute)
-#if !__has_attribute(__access__)
-#define __access__(...)
-#endif
-#if !__has_attribute(__aligned__)
-#define __aligned__(...)
-#endif
-#if !__has_attribute(__alloc_size__)
-#define __alloc_size__(...)
-#endif
-#if !__has_attribute(__cold__)
-#define __cold__
-#endif
-#if !__has_attribute(__const__)
-#define __const__
-#endif
-#if !__has_attribute(__constructor__)
-#define __constructor__
-#endif
-#if !__has_attribute(__counted_by__)
-#define __counted_by__(...)
-#endif
-#if !__has_attribute(__designated_init__)
-#define __designated_init__
-#endif
-#if !__has_attribute(__format__)
-#define __format__(...)
-#endif
-#if !__has_attribute(__malloc__)
-#define __malloc__
-#define __malloc__(...)
-#elif !defined(__GNUC__) || __GNUC__ < 13
-/* attribute malloc with argument seems to have been introduced in gcc 13 */
-#define __malloc__(...)
-#endif
-#if !__has_attribute(__noinline__)
-#define __noinline__
-#endif
-#if !__has_attribute(__nonnull__)
-#define __nonnull__(...)
-#endif
-#if !__has_attribute(__nonnull_if_nonzero__)
-#define __nonnull_if_nonzero__(...)
-#endif
-#if !__has_attribute(__nonstring__)
-#define __nonstring__
-#endif
-#if !__has_attribute(__pure__)
-#define __pure__
-#endif
-#if !__has_attribute(__returns_nonnull__)
-#define __returns_nonnull__
-#endif
-#if !__has_attribute(__sentinel__)
-#define __sentinel__
-#endif
-#if !__has_attribute(__visibility__)
-#define __visibility__(...)
-#endif
-#if !__has_attribute(__warn_unused_result__)
-#define __warn_unused_result__
-#endif
-#endif
-
-/* unreachable code */
-#ifdef __has_builtin
-#if __has_builtin(__builtin_unreachable)
-#define MT_UNREACHABLE()       do { assert(0); __builtin_unreachable(); } 
while (0)
-#endif
-#endif
-#ifndef MT_UNREACHABLE
-#if defined(_MSC_VER)
-#define MT_UNREACHABLE()       do { assert(0); __assume(0); } while (0)
-#else
-#define MT_UNREACHABLE()       do { assert(0); GDKfatal("Unreachable C code 
path reached"); } while (0)
-#endif
-#endif
-
 /*
  * @- pthreads Includes and Definitions
  */
diff --git a/monetdb5/modules/mal/batExtensions.c 
b/monetdb5/modules/mal/batExtensions.c
--- a/monetdb5/modules/mal/batExtensions.c
+++ b/monetdb5/modules/mal/batExtensions.c
@@ -26,7 +26,6 @@
 #include "mal_client.h"
 #include "mal_interpreter.h"
 #include "bat5.h"
-#include "gdk_time.h"
 #include "mal_instruction.h"
 #include "mal_exception.h"
 
diff --git a/monetdb5/modules/mal/clients.c b/monetdb5/modules/mal/clients.c
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to