Changeset: 086b2bc82754 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/086b2bc82754
Modified Files:
        gdk/gdk.h
        gdk/gdk_analytic.h
        gdk/gdk_calc_private.h
        gdk/gdk_logger.h
        gdk/gdk_logger_internals.h
        gdk/gdk_private.h
        gdk/gdk_subquery.h
        gdk/gdk_system_private.h
        gdk/gdk_time.h
Branch: default
Log Message:

Some small code rearrangements.

It is convenient to be able to edit an include file and not have the
editor point out all the "mistakes" because the syntax checker doesn't
know the various defines and typedefs.  Therefore, include gdk.h in all
these include files.  Also, make sure all files can be included any
number of times.


diffs (184 lines):

diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -41,6 +41,8 @@
 #include <string.h>
 #include <time.h>
 
+#include <sys/types.h>
+
 /* standard includes upon which all configure tests depend */
 #ifdef HAVE_SYS_STAT_H
 # include <sys/stat.h>
@@ -83,8 +85,6 @@
 # include <sys/sysctl.h>
 #endif
 
-#include <sys/types.h>
-
 #ifdef HAVE_FTIME
 #include <sys/timeb.h>         /* ftime */
 #endif
@@ -111,18 +111,15 @@
 # include <sys/mman.h>
 #endif
 
-#ifdef __APPLE__
 /* the compiler on the Mac can't deal with including xxhash.h twice
  * because of identical redefinitions of types and we happen to know
  * that the xxhash version is high enough, so just define the magic
  * inline token and include the file only once */
-#define XXH_INLINE_ALL
-#endif
-
+#ifndef __APPLE__
 #include <xxhash.h>
-
-#ifndef __APPLE__
-#if XXH_VERSION_NUMBER >= 0*100*100 + 8*100 + 0   /* at least 0.8.0 */
+#endif
+
+#if defined(__APPLE__) || XXH_VERSION_NUMBER >= 0*100*100 + 8*100 + 0   /* at 
least 0.8.0 */
 /* in newer versions, we can define XXH_INLINE_ALL to inline all hash
  * functions before including xxhash.h again (we didn't need the first
  * include, except we need the version number to make the
@@ -130,11 +127,10 @@
 #define XXH_INLINE_ALL
 #include <xxhash.h>
 #endif
-#endif
-
+
+#include "matomic.h"
+#include "mstring.h"
 #include "stream.h"
-#include "mstring.h"
-#include "matomic.h"
 
 #ifndef PATH_MAX
 #define PATH_MAX       1024
diff --git a/gdk/gdk_analytic.h b/gdk/gdk_analytic.h
--- a/gdk/gdk_analytic.h
+++ b/gdk/gdk_analytic.h
@@ -16,6 +16,8 @@
 #ifndef _GDK_ANALYTIC_H_
 #define _GDK_ANALYTIC_H_
 
+#include "gdk.h"
+
 gdk_export BAT *GDKanalyticaldiff(BAT *b, BAT *p, const bit *restrict npbit, 
int tpe)
        __attribute__((__warn_unused_result__));
 
diff --git a/gdk/gdk_calc_private.h b/gdk/gdk_calc_private.h
--- a/gdk/gdk_calc_private.h
+++ b/gdk/gdk_calc_private.h
@@ -8,12 +8,17 @@
  * For copyright information, see the file debian/copyright.
  */
 
+#ifndef _GDK_CALC_PRIVATE_H_
+#define _GDK_CALC_PRIVATE_H_
+
 /* This file contains shared definitions for gdk_calc.c and gdk_aggr.c */
 
 #ifndef LIBGDK
 #error this file should not be included outside its source directory
 #endif
 
+#include "gdk.h"
+
 /* signed version of BUN */
 #if SIZEOF_BUN == SIZEOF_INT
 #define SBUN   int
@@ -658,3 +663,5 @@ BATcalcmuldivmod(BAT *b1, BAT *b2, BAT *
                                       struct canditer *restrict,
                                       oid, oid, const char *),
                 const char *func);
+
+#endif /* _GDK_CALC_PRIVATE_H_ */
diff --git a/gdk/gdk_logger.h b/gdk/gdk_logger.h
--- a/gdk/gdk_logger.h
+++ b/gdk/gdk_logger.h
@@ -11,6 +11,8 @@
 #ifndef _LOGGER_H_
 #define _LOGGER_H_
 
+#include "gdk.h"
+
 #define LOGFILE "log"
 
 typedef gdk_return (*preversionfix_fptr)(void *data, int oldversion, int 
newversion);
diff --git a/gdk/gdk_logger_internals.h b/gdk/gdk_logger_internals.h
--- a/gdk/gdk_logger_internals.h
+++ b/gdk/gdk_logger_internals.h
@@ -11,6 +11,8 @@
 #ifndef _LOGGER_INTERNALS_H_
 #define _LOGGER_INTERNALS_H_
 
+#include "gdk.h"
+
 #define FLUSH_QUEUE_SIZE 2048 /* maximum size of the flush queue, i.e. maximum 
number of transactions committing simultaneously */
 
 typedef struct logged_range_t {
diff --git a/gdk/gdk_private.h b/gdk/gdk_private.h
--- a/gdk/gdk_private.h
+++ b/gdk/gdk_private.h
@@ -17,6 +17,7 @@
 #error this file should not be included outside its source directory
 #endif
 
+#include "gdk.h"
 #include "gdk_system_private.h"
 
 enum heaptype {
diff --git a/gdk/gdk_subquery.h b/gdk/gdk_subquery.h
--- a/gdk/gdk_subquery.h
+++ b/gdk/gdk_subquery.h
@@ -16,6 +16,8 @@
 #ifndef _GDK_SUBQUERY_H_
 #define _GDK_SUBQUERY_H_
 
+#include "gdk.h"
+
 gdk_export BAT *BATall_grp(BAT *l, BAT *g, BAT *e, BAT *s);
 gdk_export BAT *BATnil_grp(BAT *l, BAT *g, BAT *e, BAT *s);
 
diff --git a/gdk/gdk_system_private.h b/gdk/gdk_system_private.h
--- a/gdk/gdk_system_private.h
+++ b/gdk/gdk_system_private.h
@@ -8,12 +8,17 @@
  * For copyright information, see the file debian/copyright.
  */
 
+#ifndef _GDK_SYSTEM_PRIVATE_H_
+#define _GDK_SYSTEM_PRIVATE_H_
+
 /* This file should not be included in any file outside of this directory */
 
 #ifndef LIBGDK
 #error this file should not be included outside its source directory
 #endif
 
+#include "gdk.h"
+
 void dump_threads(void)
        __attribute__((__visibility__("hidden")));
 void join_detached_threads(void)
@@ -68,3 +73,5 @@ struct allocator {
 #endif
        char name[MT_NAME_LEN]; /* Name (only for display!) */
 };
+
+#endif /* _GDK_SYSTEM_PRIVATE_H_ */
diff --git a/gdk/gdk_time.h b/gdk/gdk_time.h
--- a/gdk/gdk_time.h
+++ b/gdk/gdk_time.h
@@ -11,7 +11,7 @@
 #ifndef _GDK_TIME_H_
 #define _GDK_TIME_H_
 
-#include <time.h>                      /* for time_t */
+#include "gdk.h"               /* we need gdk_export and time.h */
 
 typedef int date;                      /* we use 26 bits out of 32 */
 #define date_nil                       ((date) {int_nil})
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to