Changeset: 60bc48b446e9 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=60bc48b446e9
Modified Files:
NT/monetdb_config.h.in
clients/odbc/driver/ODBC.syms
clients/odbc/driver/SQLGetConnectAttr.c
clients/odbc/driver/SQLGetConnectOption.c
clients/odbc/driver/SQLSetConnectOption.c
common/stream/stream.c
common/utils/mutils.c
configure.ag
gdk/gdk_atoms.c
gdk/gdk_select.c
monetdb5/modules/kernel/mmath.c
monetdb5/modules/kernel/mmath.h
sql/backends/monet5/generator/generator.c
Branch: Oct2014
Log Message:
Ported to Microsoft Visual Studio 12.0.
diffs (truncated from 416 to 300 lines):
diff --git a/NT/monetdb_config.h.in b/NT/monetdb_config.h.in
--- a/NT/monetdb_config.h.in
+++ b/NT/monetdb_config.h.in
@@ -26,6 +26,7 @@
* _MSC_VER = 1400: Visual Studio 8
* _MSC_VER = 1500: Visual Studio 9.0
* _MSC_VER = 1600: Visual Studio 10.0
+ * _MSC_VER = 1800: Visual Studio 12.0
*/
/* Prevent pollution through excessive inclusion of include files by
@@ -145,13 +146,17 @@
/* #undef HAVE_FDATASYNC */
/* Define to 1 if you have the <fenv.h> header file. */
-/* #undef HAVE_FENV_H */
+#if _MSC_VER > 1600
+#define HAVE_FENV_H 1
+#endif
/* Define to 1 if you have the `fpclass' function. */
-#define HAVE_FPCLASS 1
+#define HAVE_FPCLASS 1 /* uses _fpclass, see mmath.c */
/* Define to 1 if you have the `fpclassify' function. */
-/* #undef HAVE_FPCLASSIFY */
+#if _MSC_VER > 1600
+#define HAVE_FPCLASSIFY 1
+#endif
/* Define to 1 if fseeko (and presumably ftello) exists and is declared. */
/* #undef HAVE_FSEEKO */
@@ -226,7 +231,9 @@
#define HAVE_IO_H 1
/* Define to 1 if you have the `isinf' function. */
-/* #undef HAVE_ISINF */
+#if _MSC_VER > 1600
+#define HAVE_ISINF 1
+#endif
/* Define that you want to build the jsonstore library */
/* #undef HAVE_JSONSTORE */
@@ -296,7 +303,9 @@
/* Define to 1 if you have the `llabs' function. */
#define HAVE_LLABS 1
+#if _MSC_VER <= 1500
#define llabs _abs64
+#endif
/* Define to 1 if you have the <locale.h> header file. */
#define HAVE_LOCALE_H 1
@@ -310,7 +319,7 @@
/* #undef HAVE_LOCKF */
/* Define to 1 if the system has the type `long long'. */
-#if defined(__ICL) && __ICL >= 1010
+#if _MSC_VER > 1600 || (defined(__ICL) && __ICL >= 1010)
#define HAVE_LONG_LONG 1
#else
#if _MSC_VER >= 1300
@@ -318,8 +327,6 @@
* format is interpreted the same as %ld, i.e. useless
*/
/* #define HAVE_LONG_LONG 1 */
-#else
-/* #undef HAVE_LONG_LONG */
#endif
#endif
@@ -368,6 +375,11 @@
/* Define to 1 if you have the `nl_langinfo' function. */
/* #undef HAVE_NL_LANGINFO */
+/* Define to 1 if you have the `nextafterf' function. */
+#if _MSC_VER > 1600
+#define HAVE_NEXTAFTERF 1
+#endif
+
/* Define to 1 if you have the `_NSGetExecutablePath' function. */
/* #undef HAVE__NSGETEXECUTABLEPATH */
@@ -442,7 +454,9 @@
/* #undef HAVE_RLIMIT_H */
/* Define to 1 if you have the `round' function. */
-/* #undef HAVE_ROUND */
+#if _MSC_VER > 1600
+#define HAVE_ROUND 1
+#endif
/* Define if you have the samtools (providing the bam library) */
/* #undef HAVE_SAMTOOLS */
@@ -511,7 +525,9 @@
#define HAVE_STDDEF_H 1
/* Define to 1 if you have the <stdint.h> header file. */
-/* #undef HAVE_STDINT_H */
+#if _MSC_VER > 1600
+#define HAVE_STDINT_H 1
+#endif
/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1
@@ -526,7 +542,9 @@
/* #undef HAVE_STRCASESTR */
/* Define to 1 if you have the `strftime' function. */
-/* #undef HAVE_STRFTIME */
+#if _MSC_VER >= 1500
+#define HAVE_STRFTIME 1
+#endif
/* Define to 1 if you have the <strings.h> header file. */
/* #undef HAVE_STRINGS_H */
@@ -553,28 +571,26 @@
#define HAVE_STRTOD 1
/* Define to 1 if you have the `strtof' function. */
-/* #undef HAVE_STRTOF */
+#if _MSC_VER > 1600
+#define HAVE_STRTOF 1
+#endif
#define strtok_r(t,d,c) strtok_s(t,d,c)
/* Define to 1 if you have the `strtoll' function. */
#if _MSC_VER >= 1300
#define HAVE_STRTOLL 1
-#ifndef strtoll
+#if _MSC_VER <= 1600 && !defined(strtoll)
#define strtoll _strtoi64
#endif
-#else
-/* #undef HAVE_STRTOLL */
#endif
/* Define to 1 if you have the `strtoull' function. */
#if _MSC_VER >= 1300
#define HAVE_STRTOULL 1
-#ifndef strtoull
+#if _MSC_VER <= 1600 && !defined(strtoull)
#define strtoull _strtoui64
#endif
-#else
-/* #undef HAVE_STRTOULL */
#endif
/* Define if you have struct mallinfo */
@@ -649,7 +665,9 @@
#define HAVE_TIME_H 1
/* Define to 1 if you have the `trunc' function. */
-/* #undef HAVE_TRUNC */
+#if _MSC_VER > 1600
+#define HAVE_TRUNC 1
+#endif
/* Define to 1 if you have the `uname' function. */
/* #undef HAVE_UNAME */
@@ -682,7 +700,9 @@
#define HAVE_WINSOCK_H 1
/* Define to 1 if you have the <xmmintrin.h> header file. */
-/* #undef HAVE_XMMINTRIN_H */
+#if _MSC_VER > 1600
+#define HAVE_XMMINTRIN_H 1
+#endif
/* Define to 1 if the system has the type `_Bool'. */
/* #undef HAVE__BOOL */
@@ -990,8 +1010,10 @@
#define ssize_t int
#endif
+#if _MSC_VER <= 1600
/* no va_copy in win32 */
#define va_copy(x,y) ((x) = (y))
+#endif
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
diff --git a/clients/odbc/driver/ODBC.syms b/clients/odbc/driver/ODBC.syms
--- a/clients/odbc/driver/ODBC.syms
+++ b/clients/odbc/driver/ODBC.syms
@@ -62,9 +62,9 @@ SQLFreeStmt
SQLGetConnectAttr
SQLGetConnectAttrA
SQLGetConnectAttrW
-SQLGetConnectOption
-SQLGetConnectOptionA
-SQLGetConnectOptionW
+SQLGetConnectOption=SQLGetConnectOption_deprecated
+SQLGetConnectOptionA=SQLGetConnectOptionA_deprecated
+SQLGetConnectOptionW=SQLGetConnectOptionW_deprecated
SQLGetCursorName
SQLGetCursorNameA
SQLGetCursorNameW
@@ -118,9 +118,9 @@ SQLRowCount
SQLSetConnectAttr
SQLSetConnectAttrA
SQLSetConnectAttrW
-SQLSetConnectOption
-SQLSetConnectOptionA
-SQLSetConnectOptionW
+SQLSetConnectOption=SQLSetConnectOption_deprecated
+SQLSetConnectOptionA=SQLSetConnectOptionA_deprecated
+SQLSetConnectOptionW=SQLSetConnectOptionW_deprecated
SQLSetCursorName
SQLSetCursorNameA
SQLSetCursorNameW
diff --git a/clients/odbc/driver/SQLGetConnectAttr.c
b/clients/odbc/driver/SQLGetConnectAttr.c
--- a/clients/odbc/driver/SQLGetConnectAttr.c
+++ b/clients/odbc/driver/SQLGetConnectAttr.c
@@ -83,7 +83,7 @@ SQLGetConnectAttr_(ODBCDbc *dbc,
*(SQLUINTEGER *) ValuePtr = dbc->sql_attr_metadata_id;
break;
case SQL_ATTR_ODBC_CURSORS:
- *(SQLUINTEGER *) ValuePtr = SQL_CUR_USE_IF_NEEDED;
+ *(SQLUINTEGER *) ValuePtr = SQL_CUR_USE_DRIVER;
break;
case SQL_ATTR_TRACE:
*(SQLUINTEGER *) ValuePtr = SQL_OPT_TRACE_OFF;
diff --git a/clients/odbc/driver/SQLGetConnectOption.c
b/clients/odbc/driver/SQLGetConnectOption.c
--- a/clients/odbc/driver/SQLGetConnectOption.c
+++ b/clients/odbc/driver/SQLGetConnectOption.c
@@ -37,6 +37,15 @@
#include "ODBCDbc.h"
#include "ODBCUtil.h"
+#ifdef _MSC_VER
+/* can't call them by their real name with Visual Studio 12.0 since we
+ * would then get a warning which we translate to an error during
+ * compilation (also see ODBS.syms) */
+#define SQLGetConnectOption SQLGetConnectOption_deprecated
+#define SQLGetConnectOptionA SQLGetConnectOptionA_deprecated
+#define SQLGetConnectOptionW SQLGetConnectOptionW_deprecated
+#endif
+
static SQLRETURN
SQLGetConnectOption_(ODBCDbc *dbc,
SQLUSMALLINT Option,
diff --git a/clients/odbc/driver/SQLSetConnectOption.c
b/clients/odbc/driver/SQLSetConnectOption.c
--- a/clients/odbc/driver/SQLSetConnectOption.c
+++ b/clients/odbc/driver/SQLSetConnectOption.c
@@ -41,6 +41,15 @@
#include "ODBCDbc.h"
#include "ODBCUtil.h"
+#ifdef _MSC_VER
+/* can't call them by their real name with Visual Studio 12.0 since we
+ * would then get a warning which we translate to an error during
+ * compilation (also see ODBS.syms) */
+#define SQLSetConnectOption SQLSetConnectOption_deprecated
+#define SQLSetConnectOptionA SQLSetConnectOptionA_deprecated
+#define SQLSetConnectOptionW SQLSetConnectOptionW_deprecated
+#endif
+
static SQLRETURN
SQLSetConnectOption_(ODBCDbc *dbc,
SQLUSMALLINT Option,
diff --git a/common/stream/stream.c b/common/stream/stream.c
--- a/common/stream/stream.c
+++ b/common/stream/stream.c
@@ -2058,6 +2058,38 @@ udp_create(const char *name)
static int
udp_socket(udp_stream * udp, const char *hostname, int port, int write)
{
+#ifdef HAVE_GETADDRINFO
+ struct addrinfo hints, *res, *rp;
+ char sport[32];
+
+ snprintf(sport, sizeof(sport), "%d", port);
+ memset(&hints, 0, sizeof(hints));
+ hints.ai_family = AF_UNSPEC; /* IPv4 or IPv6 */
+ hints.ai_socktype = SOCK_DGRAM;
+ hints.ai_flags = AI_PASSIVE;
+ hints.ai_protocol = IPPROTO_UDP;
+ if (getaddrinfo(hostname, sport, &hints, &res))
+ return -1;
+ memset(&udp->addr, 0, sizeof(udp->addr));
+ for (rp = res; rp; rp = rp->ai_next) {
+ udp->s = socket(rp->ai_family, rp->ai_socktype,
rp->ai_protocol);
+ if (udp->s == INVALID_SOCKET)
+ continue;
+ if (!write &&
+ bind(udp->s, rp->ai_addr,
+#ifdef _MSC_VER
+ (int) /* Windows got the interface wrong... */
+#endif
+ rp->ai_addrlen) == SOCKET_ERROR) {
+ closesocket(udp->s);
+ continue;
+ }
+ memcpy(&udp->addr, rp->ai_addr, rp->ai_addrlen);
+ freeaddrinfo(res);
+ return 0;
+ }
+ return -1;
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list