sqllogictest
Check-in [7a6b266590]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add Makefile for MSVC, making #ifdef adjustments as necessary.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:7a6b2665904f8fa31e46cb192206f273863c6809
User & Date: mistachkin 2015-10-10 22:39:20
Context
2016-01-04
21:04
Bring in the latest SQLite 3.10.0 beta. check-in: 08c712f2f6 user: drh tags: trunk
2015-10-10
22:39
Add Makefile for MSVC, making #ifdef adjustments as necessary. check-in: 7a6b266590 user: mistachkin tags: trunk
18:53
Another SQLite 3.9.0 beta. check-in: 7f101da5c9 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/Makefile.mingw.

4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#    Nothing for unix.
#
E =

#### C Compile and options for use in building executables that 
#    will run on the target platform.
#
CC = gcc -g -Wall -DWIN32=1
#CC = gcc -g -Wall -DOMIT_ODBC=1 -fprofile-arcs -ftest-coverage
#CC += -DSQLITE_COVERAGE_TEST
CC += -DSQLITE_NO_SYNC=1

#### Extra arguments for linking the finished binary. 
#
LIB = $(LDFLAGS)







|







4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#    Nothing for unix.
#
E =

#### C Compile and options for use in building executables that 
#    will run on the target platform.
#
CC = gcc -g -Wall
#CC = gcc -g -Wall -DOMIT_ODBC=1 -fprofile-arcs -ftest-coverage
#CC += -DSQLITE_COVERAGE_TEST
CC += -DSQLITE_NO_SYNC=1

#### Extra arguments for linking the finished binary. 
#
LIB = $(LDFLAGS)

Added src/Makefile.msc.

















































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#
# nmake Makefile for sqllogictest
#
###############################################################################

# The toplevel directory of the source tree.  This is the directory that
# contains this "Makefile.msc".
#
TOP = .

# Check for the predefined command macro CC.  This should point to the compiler
# binary for the target platform.  If it is not defined, simply define it to
# the legacy default value 'cl.exe'.
#
!IFNDEF CC
CC = cl.exe
!ENDIF

# Check for the command macro LD.  This should point to the linker binary for
# the target platform.  If it is not defined, simply define it to the legacy
# default value 'link.exe'.
#
!IFNDEF LD
LD = link.exe
!ENDIF

# C compiler and options for use in building executables that
# will run on the target platform.  (BCC and TCC are usually the
# same unless your are cross-compiling.)
#
TCC = $(CC) -nologo -W3
TCC = $(TCC) -I$(TOP) -fp:precise

# Prevent warnings about "insecure" MSVC runtime library functions
# being used.
#
TCC = $(TCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
BCC = $(BCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS
RCC = $(RCC) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS

# Prevent warnings about "deprecated" POSIX functions being used.
#
TCC = $(TCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
BCC = $(BCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS
RCC = $(RCC) -D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_NONSTDC_NO_WARNINGS

# Add in any optional parameters specified on the commane line, e.g.
# nmake /f Makefile.msc all "OPTS=-DSQLITE_ENABLE_FOO=1 -DSQLITE_OMIT_FOO=1"
#
TCC = $(TCC) $(OPTS)
RCC = $(RCC) $(OPTS)

# This is the default Makefile target.  The objects listed here
# are what get build when you type just "make" with no arguments.
#
all:	sqllogictest.exe

# Rules to build individual *.lo files from files in the src directory.
#
md5.lo:	$(TOP)\md5.c
	$(TCC) -Fo$@ -c $(TOP)\md5.c

sqlite3.lo:	$(TOP)\sqlite3.c
	$(TCC) -Fo$@ -c $(TOP)\sqlite3.c

sqllogictest.exe:	md5.lo sqlite3.lo
	$(TCC) -Fe$@ $(TOP)\sqllogictest.c /link odbc32.lib md5.lo sqlite3.lo

clean:
	del /Q *.exp *.lo *.ilk *.lib *.obj *.ncb *.pdb *.sdf *.suo 2>NUL
	del /Q *.bsc *.cod *.da *.bb *.bbg gmon.out 2>NUL
	del /Q sqllogictest.exe 2>NUL

Changes to src/slt_odbc3.c.

30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
...
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
**
** The DSN name and DB name are controlled by the defines
** SLT_DSN and SLT_DB.
**
*/
#ifndef OMIT_ODBC  /* Omit this module if OMIT_ODBC is defined */

#ifdef WIN32
#include <windows.h>
#endif
#define SQL_NOUNICODEMAP
#include <sql.h>
#include <sqlext.h>


................................................................................
/*
** Append a value to a result set.  zValue is copied into memory obtained
** from malloc.  Or if zValue is NULL, then a NULL pointer is appended.
*/
static void ODBC3_appendValue(ODBC3_resAccum *p, const char *zValue){
  char *z;
  if( zValue ){
#ifdef WIN32
    z = _strdup(zValue);
#else
    z = strdup(zValue);
#endif
    if( z==0 ){
      fprintf(stderr, "out of memory at %s:%d\n", __FILE__,__LINE__);
      exit(1);







|







 







|







30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
...
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
**
** The DSN name and DB name are controlled by the defines
** SLT_DSN and SLT_DB.
**
*/
#ifndef OMIT_ODBC  /* Omit this module if OMIT_ODBC is defined */

#ifdef _WIN32
#include <windows.h>
#endif
#define SQL_NOUNICODEMAP
#include <sql.h>
#include <sqlext.h>


................................................................................
/*
** Append a value to a result set.  zValue is copied into memory obtained
** from malloc.  Or if zValue is NULL, then a NULL pointer is appended.
*/
static void ODBC3_appendValue(ODBC3_resAccum *p, const char *zValue){
  char *z;
  if( zValue ){
#ifdef _WIN32
    z = _strdup(zValue);
#else
    z = strdup(zValue);
#endif
    if( z==0 ){
      fprintf(stderr, "out of memory at %s:%d\n", __FILE__,__LINE__);
      exit(1);

Changes to src/slt_sqlite.c.

85
86
87
88
89
90
91
92
93
94
95
96
97
98
99

  /* If the database filename is defined and the database already exists,
  ** then delete the database before we start, thus resetting it to an
  ** empty database.
  */
  if( zConnectStr==0 ) zConnectStr = "test.db";
  if( zConnectStr && zConnectStr[0] ){
#ifndef WIN32
    unlink(zConnectStr);
#else
    _unlink(zConnectStr);
#endif
  }

  p = sqlite3_malloc( sizeof(*p) );







|







85
86
87
88
89
90
91
92
93
94
95
96
97
98
99

  /* If the database filename is defined and the database already exists,
  ** then delete the database before we start, thus resetting it to an
  ** empty database.
  */
  if( zConnectStr==0 ) zConnectStr = "test.db";
  if( zConnectStr && zConnectStr[0] ){
#ifndef _WIN32
    unlink(zConnectStr);
#else
    _unlink(zConnectStr);
#endif
  }

  p = sqlite3_malloc( sizeof(*p) );

Changes to src/sqllogictest.c.

19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
**   drh@hwaci.com
**   http://www.hwaci.com/drh/
**
*******************************************************************************
**
** This main driver for the sqllogictest program.
*/
#ifdef WIN32
#define _CRT_SECURE_NO_WARNINGS
#endif

#include "sqllogictest.h"
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#ifndef WIN32
#include <unistd.h>
#define stricmp strcasecmp
#endif
#include <string.h>

#include "slt_sqlite.c"
#include "slt_odbc3.c"







<
<
<
<




|







19
20
21
22
23
24
25




26
27
28
29
30
31
32
33
34
35
36
37
**   drh@hwaci.com
**   http://www.hwaci.com/drh/
**
*******************************************************************************
**
** This main driver for the sqllogictest program.
*/




#include "sqllogictest.h"
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#ifndef _WIN32
#include <unistd.h>
#define stricmp strcasecmp
#endif
#include <string.h>

#include "slt_sqlite.c"
#include "slt_odbc3.c"