Changeset: 6af15a52be66 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6af15a52be66
Modified Files:
clients/mapiclient/dump.c
clients/mapiclient/eventparser.h
clients/mapiclient/mclient.c
clients/mapiclient/mnc.c
clients/mapiclient/msqldump.c
clients/odbc/setup/drvcfg.h
common/stream/stream.c
common/stream/stream.h
common/utils/msabaoth.c
common/utils/prompt.c
gdk/gdk_interprocess.c
gdk/gdk_posix.c
gdk/gdk_system.c
gdk/gdk_utils.c
monetdb5/mal/mal.c
monetdb5/mal/mal.h
monetdb5/mal/mal_import.c
monetdb5/mal/mal_import.h
monetdb5/mal/mal_parser.c
monetdb5/mal/mal_sabaoth.c
monetdb5/mal/mal_session.c
monetdb5/mal/mal_session.h
monetdb5/modules/mal/remote.h
sql/backends/monet5/UDF/capi/capi.c
sql/backends/monet5/sql_execute.c
sql/backends/monet5/sql_result.c
sql/backends/monet5/sql_scenario.c
sql/backends/monet5/sql_scenario.h
sql/backends/monet5/sql_upgrades.c
sql/benchmarks/hist-uva/ground/main.c
sql/benchmarks/xmark/unix.c
sql/server/rel_semantic.c
sql/server/sql_mvc.c
sql/server/sql_parser.y
sql/server/sql_scan.c
sql/server/sql_semantic.c
tools/merovingian/client/monetdb.c
tools/merovingian/daemon/argvcmds.c
tools/merovingian/daemon/controlrunner.c
tools/merovingian/daemon/forkmserver.c
tools/merovingian/daemon/handlers.c
tools/merovingian/daemon/merovingian.c
tools/merovingian/daemon/multiplex-funnel.c
tools/merovingian/utils/control.c
tools/merovingian/utils/database.c
tools/merovingian/utils/utils.c
tools/mserver/mserver5.c
tools/mserver/shutdowntest.c
Branch: port-monetdblite
Log Message:
Added header file checks, cleaned stream module, ported mvc_export_prepare.
diffs (truncated from 1587 to 300 lines):
diff --git a/clients/mapiclient/dump.c b/clients/mapiclient/dump.c
--- a/clients/mapiclient/dump.c
+++ b/clients/mapiclient/dump.c
@@ -10,7 +10,9 @@
#include "monet_options.h"
#include "mapi.h"
#include "stream.h"
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif
#include <string.h>
#include <ctype.h>
#include "msqldump.h"
diff --git a/clients/mapiclient/eventparser.h b/clients/mapiclient/eventparser.h
--- a/clients/mapiclient/eventparser.h
+++ b/clients/mapiclient/eventparser.h
@@ -24,7 +24,9 @@
#include <string.h>
#include <sys/stat.h>
#include <signal.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif
#include <time.h>
#define TME_US 1
diff --git a/clients/mapiclient/mclient.c b/clients/mapiclient/mclient.c
--- a/clients/mapiclient/mclient.c
+++ b/clients/mapiclient/mclient.c
@@ -22,7 +22,9 @@
# endif
#endif
#include "mapi.h"
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif
#include <string.h>
#ifdef HAVE_STRINGS_H
#include <strings.h> /* strcasecmp */
diff --git a/clients/mapiclient/mnc.c b/clients/mapiclient/mnc.c
--- a/clients/mapiclient/mnc.c
+++ b/clients/mapiclient/mnc.c
@@ -22,7 +22,9 @@
#include "stream_socket.h"
#include <string.h>
#include <signal.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif
#ifdef HAVE_PTHREAD_H
#include <pthread.h>
#endif
diff --git a/clients/mapiclient/msqldump.c b/clients/mapiclient/msqldump.c
--- a/clients/mapiclient/msqldump.c
+++ b/clients/mapiclient/msqldump.c
@@ -15,7 +15,9 @@
# endif
#endif
#include "mapi.h"
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif
#include <sys/stat.h>
#include <string.h>
#include <time.h>
diff --git a/clients/odbc/setup/drvcfg.h b/clients/odbc/setup/drvcfg.h
--- a/clients/odbc/setup/drvcfg.h
+++ b/clients/odbc/setup/drvcfg.h
@@ -20,7 +20,9 @@
#ifndef _ODBCINST_H
#define _ODBCINST_H
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif
#ifdef HAVE_PWD_H
#include <pwd.h>
#endif
diff --git a/common/stream/stream.c b/common/stream/stream.c
--- a/common/stream/stream.c
+++ b/common/stream/stream.c
@@ -131,55 +131,6 @@
#define UTF8BOM "\xEF\xBB\xBF" /* UTF-8 encoding of Unicode
BOM */
#define UTF8BOMLENGTH 3 /* length of above */
-#ifdef _MSC_VER
-/* use intrinsic functions on Windows */
-#define short_int_SWAP(s) ((int16_t) _byteswap_ushort((uint16_t) (s)))
-/* on Windows, long is the same size as int */
-#define normal_int_SWAP(i) ((int) _byteswap_ulong((unsigned long) (i)))
-#define long_int_SWAP(l) ((int64_t) _byteswap_uint64((unsigned __int64)
(l)))
-#else
-#define short_int_SWAP(s) \
- ((int16_t) (((0x00ff & (uint16_t) (s)) << 8) | \
- ((0xff00 & (uint16_t) (s)) >> 8)))
-
-#define normal_int_SWAP(i) \
- ((int) (((((unsigned) 0xff << 0) & (unsigned) (i)) << 24) | \
- ((((unsigned) 0xff << 8) & (unsigned) (i)) << 8) | \
- ((((unsigned) 0xff << 16) & (unsigned) (i)) >> 8) | \
- ((((unsigned) 0xff << 24) & (unsigned) (i)) >> 24)))
-
-#define long_int_SWAP(l) \
- ((int64_t) (((((uint64_t) 0xff << 0) & (uint64_t) (l)) << 56) | \
- ((((uint64_t) 0xff << 8) & (uint64_t) (l)) << 40) | \
- ((((uint64_t) 0xff << 16) & (uint64_t) (l)) << 24) | \
- ((((uint64_t) 0xff << 24) & (uint64_t) (l)) << 8) | \
- ((((uint64_t) 0xff << 32) & (uint64_t) (l)) >> 8) | \
- ((((uint64_t) 0xff << 40) & (uint64_t) (l)) >> 24) | \
- ((((uint64_t) 0xff << 48) & (uint64_t) (l)) >> 40) | \
- ((((uint64_t) 0xff << 56) & (uint64_t) (l)) >> 56)))
-#endif
-
-#ifdef HAVE_HGE
-#define huge_int_SWAP(h) \
- ((hge) (((((uhge) 0xff << 0) & (uhge) (h)) << 120) | \
- ((((uhge) 0xff << 8) & (uhge) (h)) << 104) | \
- ((((uhge) 0xff << 16) & (uhge) (h)) << 88) | \
- ((((uhge) 0xff << 24) & (uhge) (h)) << 72) | \
- ((((uhge) 0xff << 32) & (uhge) (h)) << 56) | \
- ((((uhge) 0xff << 40) & (uhge) (h)) << 40) | \
- ((((uhge) 0xff << 48) & (uhge) (h)) << 24) | \
- ((((uhge) 0xff << 56) & (uhge) (h)) << 8) | \
- ((((uhge) 0xff << 64) & (uhge) (h)) >> 8) | \
- ((((uhge) 0xff << 72) & (uhge) (h)) >> 24) | \
- ((((uhge) 0xff << 80) & (uhge) (h)) >> 40) | \
- ((((uhge) 0xff << 88) & (uhge) (h)) >> 56) | \
- ((((uhge) 0xff << 96) & (uhge) (h)) >> 72) | \
- ((((uhge) 0xff << 104) & (uhge) (h)) >> 88) | \
- ((((uhge) 0xff << 112) & (uhge) (h)) >> 104) | \
- ((((uhge) 0xff << 120) & (uhge) (h)) >> 120)))
-#endif
-
-
struct stream {
char *name; /* name of the stream */
bool swapbytes; /* whether to swap bytes */
@@ -216,7 +167,7 @@ mnstr_init(void)
if (inited)
return 0;
-#ifdef NATIVE_WIN32
+#if defined(NATIVE_WIN32) && !defined(HAVE_EMBEDDED)
{
WSADATA w;
@@ -2153,6 +2104,7 @@ open_wastream(const char *filename)
return s;
}
+#ifndef HAVE_EMBEDDED
/* ------------------------------------------------------------------ */
/* streams working on a remote file using cURL */
@@ -2932,6 +2884,7 @@ console_destroy(stream *s)
destroy(s);
}
#endif
+#endif /* HAVE EMBEDDED*/
static stream *
file_stream(const char *name)
@@ -3088,7 +3041,7 @@ file_wastream(FILE *restrict fp, const c
FILE *
getFile(stream *s)
{
-#ifdef _MSC_VER
+#if defined(_MSC_VER) && !defined(HAVE_EMBEDDED)
if (s->read == console_read)
return stdin;
if (s->write == console_write)
diff --git a/common/stream/stream.h b/common/stream/stream.h
--- a/common/stream/stream.h
+++ b/common/stream/stream.h
@@ -21,7 +21,9 @@
* required for proper conversion on different byte order platforms.
*/
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif
#include <ctype.h>
#include <stdio.h>
@@ -80,6 +82,54 @@ typedef __int128_t hge;
#define STREAM_FWF_RECORD_SEP '\n'
#define STREAM_FWF_FILLER ' '
+#ifdef _MSC_VER
+/* use intrinsic functions on Windows */
+#define short_int_SWAP(s) ((int16_t) _byteswap_ushort((uint16_t) (s)))
+/* on Windows, long is the same size as int */
+#define normal_int_SWAP(i) ((int) _byteswap_ulong((unsigned long) (i)))
+#define long_int_SWAP(l) ((int64_t) _byteswap_uint64((unsigned __int64)
(l)))
+#else
+#define short_int_SWAP(s) \
+ ((int16_t) (((0x00ff & (uint16_t) (s)) << 8) | \
+ ((0xff00 & (uint16_t) (s)) >> 8)))
+
+#define normal_int_SWAP(i) \
+ ((int) (((((unsigned) 0xff << 0) & (unsigned) (i)) << 24) | \
+ ((((unsigned) 0xff << 8) & (unsigned) (i)) << 8) | \
+ ((((unsigned) 0xff << 16) & (unsigned) (i)) >> 8) | \
+ ((((unsigned) 0xff << 24) & (unsigned) (i)) >> 24)))
+
+#define long_int_SWAP(l) \
+ ((int64_t) (((((uint64_t) 0xff << 0) & (uint64_t) (l)) << 56) | \
+ ((((uint64_t) 0xff << 8) & (uint64_t) (l)) << 40) | \
+ ((((uint64_t) 0xff << 16) & (uint64_t) (l)) << 24) | \
+ ((((uint64_t) 0xff << 24) & (uint64_t) (l)) << 8) | \
+ ((((uint64_t) 0xff << 32) & (uint64_t) (l)) >> 8) | \
+ ((((uint64_t) 0xff << 40) & (uint64_t) (l)) >> 24) | \
+ ((((uint64_t) 0xff << 48) & (uint64_t) (l)) >> 40) | \
+ ((((uint64_t) 0xff << 56) & (uint64_t) (l)) >> 56)))
+#endif
+
+#ifdef HAVE_HGE
+#define huge_int_SWAP(h) \
+ ((hge) (((((uhge) 0xff << 0) & (uhge) (h)) << 120) | \
+ ((((uhge) 0xff << 8) & (uhge) (h)) << 104) | \
+ ((((uhge) 0xff << 16) & (uhge) (h)) << 88) | \
+ ((((uhge) 0xff << 24) & (uhge) (h)) << 72) | \
+ ((((uhge) 0xff << 32) & (uhge) (h)) << 56) | \
+ ((((uhge) 0xff << 40) & (uhge) (h)) << 40) | \
+ ((((uhge) 0xff << 48) & (uhge) (h)) << 24) | \
+ ((((uhge) 0xff << 56) & (uhge) (h)) << 8) | \
+ ((((uhge) 0xff << 64) & (uhge) (h)) >> 8) | \
+ ((((uhge) 0xff << 72) & (uhge) (h)) >> 24) | \
+ ((((uhge) 0xff << 80) & (uhge) (h)) >> 40) | \
+ ((((uhge) 0xff << 88) & (uhge) (h)) >> 56) | \
+ ((((uhge) 0xff << 96) & (uhge) (h)) >> 72) | \
+ ((((uhge) 0xff << 104) & (uhge) (h)) >> 88) | \
+ ((((uhge) 0xff << 112) & (uhge) (h)) >> 104) | \
+ ((((uhge) 0xff << 120) & (uhge) (h)) >> 120)))
+#endif
+
typedef struct stream stream;
/* some os specific initialization */
diff --git a/common/utils/msabaoth.c b/common/utils/msabaoth.c
--- a/common/utils/msabaoth.c
+++ b/common/utils/msabaoth.c
@@ -18,7 +18,9 @@
*/
#include "monetdb_config.h"
-#include <unistd.h> /* unlink and friends */
+#ifdef HAVE_UNISTD_H
+#include <unistd.h> /* unlink and friends */
+#endif
#include <sys/types.h>
#ifdef HAVE_DIRENT_H
#include <dirent.h> /* readdir, DIR */
diff --git a/common/utils/prompt.c b/common/utils/prompt.c
--- a/common/utils/prompt.c
+++ b/common/utils/prompt.c
@@ -7,7 +7,9 @@
*/
#include "monetdb_config.h"
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif
#include <string.h>
#ifndef _MSC_VER
#ifdef HAVE_TERMIOS_H
diff --git a/gdk/gdk_interprocess.c b/gdk/gdk_interprocess.c
--- a/gdk/gdk_interprocess.c
+++ b/gdk/gdk_interprocess.c
@@ -20,7 +20,9 @@
#include <sys/ipc.h>
#include <sys/shm.h>
#include <sys/wait.h>
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif
#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>
diff --git a/gdk/gdk_posix.c b/gdk/gdk_posix.c
--- a/gdk/gdk_posix.c
+++ b/gdk/gdk_posix.c
@@ -19,7 +19,9 @@
#include "gdk.h" /* includes gdk_posix.h */
#include "gdk_private.h"
#include "mutils.h"
+#ifdef HAVE_UNISTD_H
#include <unistd.h>
+#endif
#include <string.h> /* strncpy */
#ifdef HAVE_FCNTL_H
diff --git a/gdk/gdk_system.c b/gdk/gdk_system.c
--- a/gdk/gdk_system.c
+++ b/gdk/gdk_system.c
@@ -44,7 +44,9 @@
#include <signal.h>
-#include <unistd.h> /* for sysconf symbols */
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list