Changeset: c79759fbb527 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c79759fbb527
Modified Files:
NT/monetdb_config.h.in
clients/examples/C/smack00.c
clients/examples/C/smack01.c
clients/odbc/samples/arraytest.c
clients/odbc/samples/odbcsample1.c
clients/odbc/samples/testStmtAttr.c
clients/odbc/samples/testgetinfo.c
Branch: Jun2020
Log Message:
On Windows just use snprintf, add a comment.
diffs (98 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
@@ -808,6 +808,10 @@
/* #undef size_t */
#if defined(_MSC_VER) && _MSC_VER < 1900
+/* the Visual Studio 2015 version of snprintf is C99 standard
+ * compliant and different from _snprintf, in older versions, the
+ * functions are the same and return -1 when the buffer is too
+ * small */
#define snprintf c99_snprintf
#define vsnprintf c99_vsnprintf
diff --git a/clients/examples/C/smack00.c b/clients/examples/C/smack00.c
--- a/clients/examples/C/smack00.c
+++ b/clients/examples/C/smack00.c
@@ -16,10 +16,6 @@
#include <string.h>
#include <mapi.h>
-#ifdef _MSC_VER
-#define snprintf _snprintf
-#endif
-
#define die(dbh,hdl) do { \
if (hdl) \
mapi_explain_result(hdl,stderr); \
diff --git a/clients/examples/C/smack01.c b/clients/examples/C/smack01.c
--- a/clients/examples/C/smack01.c
+++ b/clients/examples/C/smack01.c
@@ -16,10 +16,6 @@
#include <string.h>
#include <mapi.h>
-#ifdef _MSC_VER
-#define snprintf _snprintf
-#endif
-
#define die(dbh,hdl) do { \
if (hdl) \
mapi_explain_result(hdl,stderr); \
diff --git a/clients/odbc/samples/arraytest.c b/clients/odbc/samples/arraytest.c
--- a/clients/odbc/samples/arraytest.c
+++ b/clients/odbc/samples/arraytest.c
@@ -19,10 +19,6 @@
#include <sql.h>
#include <sqlext.h>
-#ifdef _MSC_VER
-#define snprintf _snprintf
-#endif
-
static void
prerr(SQLSMALLINT tpe, SQLHANDLE hnd, const char *func, const char *pref)
{
diff --git a/clients/odbc/samples/odbcsample1.c
b/clients/odbc/samples/odbcsample1.c
--- a/clients/odbc/samples/odbcsample1.c
+++ b/clients/odbc/samples/odbcsample1.c
@@ -18,10 +18,6 @@
#include <sql.h>
#include <sqlext.h>
-#ifdef _MSC_VER
-#define snprintf _snprintf
-#endif
-
static void
prerr(SQLSMALLINT tpe, SQLHANDLE hnd, const char *func, const char *pref)
{
diff --git a/clients/odbc/samples/testStmtAttr.c
b/clients/odbc/samples/testStmtAttr.c
--- a/clients/odbc/samples/testStmtAttr.c
+++ b/clients/odbc/samples/testStmtAttr.c
@@ -15,10 +15,6 @@
#include <sql.h>
#include <sqlext.h>
-#ifdef _MSC_VER
-#define snprintf _snprintf
-#endif
-
static void
prerr(SQLSMALLINT tpe, SQLHANDLE hnd, const char *func, const char *pref)
{
diff --git a/clients/odbc/samples/testgetinfo.c
b/clients/odbc/samples/testgetinfo.c
--- a/clients/odbc/samples/testgetinfo.c
+++ b/clients/odbc/samples/testgetinfo.c
@@ -21,10 +21,6 @@
#include <sql.h>
#include <sqlext.h>
-#ifdef _MSC_VER
-#define snprintf _snprintf
-#endif
-
static void
prerr(SQLSMALLINT tpe, SQLHANDLE hnd, const char *func, const char *pref)
{
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list