diff --git a/harbour/ChangeLog b/harbour/ChangeLog index a3d9633ce0..2bc3e8798c 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,30 @@ 2002-12-01 13:30 UTC+0100 Foo Bar */ +2007-11-24 01:58 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * contrib/msql/Makefile + * contrib/msql/make_b32.bat + * contrib/msql/make_vc.bat + * contrib/msql/msql.h + * contrib/msql/tmsql.prg + ! Fixed to compile with non-GNU BC/VC makefiles. + (short-term fixes, there may be better / more generic + ways to fix it) + ! C warnings fixed. + ! Harbour warnings fixed. + ! Makefile changed to Harbour standard GNU format. + + * contrib/make_b32_all.bat + * contrib/make_vc_all.bat + + msql enabled. + + - contrib/msql/dbf2msql.prg + - contrib/msql/test.prg + + contrib/msql/tests + + contrib/msql/tests/dbf2msql.prg + + contrib/msql/tests/test.prg + * Tests moved to tests dir. + 2007-11-23 21:18 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/mtpl_vc.mak ! Some minor fixes for VC. diff --git a/harbour/contrib/make_b32_all.bat b/harbour/contrib/make_b32_all.bat index 22ee9e0591..f6aec612ca 100644 --- a/harbour/contrib/make_b32_all.bat +++ b/harbour/contrib/make_b32_all.bat @@ -8,12 +8,12 @@ rem IT or you will break Win9x command.com line length limit !!! set HB_SHOW_ERRORS=no -set DO_NOT_COMPILE=examples hbclip hgf msql +set DO_NOT_COMPILE=examples hbclip hgf -set DIRS=adordd bmdbfcdx btree libct libgt libmisc libnf ole +set DIRS=adordd bmdbfcdx btree libct libgt libmisc libnf msql for %%n in ( %DIRS% ) do %COMSPEC% /c make_b32.bat %%n %1 %2 %3 %4 %5 %6 %7 %8 %9 -set DIRS=hbzlib htmllib odbc telepath tip win32 xhb +set DIRS=ole hbzlib htmllib odbc telepath tip win32 xhb for %%n in ( %DIRS% ) do %COMSPEC% /c make_b32.bat %%n %1 %2 %3 %4 %5 %6 %7 %8 %9 set DIRS=samples directx diff --git a/harbour/contrib/make_vc_all.bat b/harbour/contrib/make_vc_all.bat index 9f1e94696d..37f7a72eea 100644 --- a/harbour/contrib/make_vc_all.bat +++ b/harbour/contrib/make_vc_all.bat @@ -8,12 +8,12 @@ rem IT or you will break Win9x command.com line length limit !!! set HB_SHOW_ERRORS=no -set DO_NOT_COMPILE=examples hbclip hgf msql +set DO_NOT_COMPILE=examples hbclip hgf -set DIRS=adordd bmdbfcdx btree libct libgt libmisc libnf ole +set DIRS=adordd bmdbfcdx btree libct libgt libmisc libnf msql for %%n in ( %DIRS% ) do %COMSPEC% /c make_vc.bat %%n %1 %2 %3 %4 %5 %6 %7 %8 %9 -set DIRS=hbzlib htmllib odbc telepath tip win32 xhb +set DIRS=ole hbzlib htmllib odbc telepath tip win32 xhb for %%n in ( %DIRS% ) do %COMSPEC% /c make_vc.bat %%n %1 %2 %3 %4 %5 %6 %7 %8 %9 set DIRS=samples directx diff --git a/harbour/contrib/msql/Makefile b/harbour/contrib/msql/Makefile index 0bff30422b..bdd853db5a 100644 --- a/harbour/contrib/msql/Makefile +++ b/harbour/contrib/msql/Makefile @@ -2,41 +2,17 @@ # $Id$ # -CompOptions = -m -n -I../include +ROOT = ../../ +C_SOURCES=\ + msql.c \ -msqlobjects = msql.o tmsql.o -msqlprecomp = msql.c tmsql.c -msqlsource = tmsql.prg +PRG_SOURCES=\ + tmsql.prg \ -tobjects = test.o -tprecomp = test.c -tsource = test.prg +PRG_HEADERS=\ + msql.ch \ -dobjects = dbf2msql.o -dprecomp = dbf2msql.c -dsource = dbf2msql.prg - -$(msqlobjects): $(msqlprecomp) - gcc -O2 -c $(msqlprecomp) -I..\include -$(msqlprecomp): $(msqlsource) - ..\bin\harbour $(CompOptions) $(msqlsource) - - -test: $(tobjects) $(msqlobjects) - gcc -O2 -o test.exe $(tobjects) $(msqlobjects) -I..\include -L..\lib -lrtl -lvm -lgtos2 -lrdd -llang -lmacro -lpp -ldbfntx -lcommon -lrtl -lvm -llibmsql -lsocket - -$(tobjects): $(tprecomp) - gcc -O2 -c $(tprecomp) -I..\include -$(tprecomp): $(tsource) - ..\bin\harbour $(CompOptions) $(tsource) - - -dbf2msql: $(dobjects) $(msqlobjects) - gcc -O2 -o dbf2msql.exe $(dobjects) $(msqlobjects) -I..\include -L..\lib -lrtl -lvm -lgtos2 -lrdd -llang -lmacro -lpp -ldbfntx -lcommon -lrtl -lvm -llibmsql -lsocket - -$(dobjects): $(dprecomp) - gcc -O2 -c $(dprecomp) -I..\include -$(dprecomp): $(dsource) - ..\bin\harbour $(CompOptions) $(dsource) +LIBNAME=msql +include $(TOP)$(ROOT)config/lib.cf diff --git a/harbour/contrib/msql/make_b32.bat b/harbour/contrib/msql/make_b32.bat index c484512c4c..3c418ccf7d 100644 --- a/harbour/contrib/msql/make_b32.bat +++ b/harbour/contrib/msql/make_b32.bat @@ -3,4 +3,6 @@ rem rem $Id$ rem +set CFLAGS=-D_OS_WIN32 + call ..\mtpl_b32.bat %1 %2 %3 %4 %5 %6 %7 %8 %9 diff --git a/harbour/contrib/msql/make_vc.bat b/harbour/contrib/msql/make_vc.bat index 4ceb9b9261..ead8e70b68 100644 --- a/harbour/contrib/msql/make_vc.bat +++ b/harbour/contrib/msql/make_vc.bat @@ -3,4 +3,6 @@ rem rem $Id$ rem +set CFLAGS=-D_OS_WIN32 + call ..\mtpl_vc.bat %1 %2 %3 %4 %5 %6 %7 %8 %9 diff --git a/harbour/contrib/msql/msql.h b/harbour/contrib/msql/msql.h index 14f861ef02..927222bcad 100644 --- a/harbour/contrib/msql/msql.h +++ b/harbour/contrib/msql/msql.h @@ -24,7 +24,11 @@ #define MSQL_H #include +#if defined(__BORLANDC__) || defined(_MSC_VER) +#include /* needed for time_t prototypes */ +#else #include /* needed for time_t prototypes */ +#endif #ifndef APIENTRY @@ -50,7 +54,7 @@ #endif -#if defined(__STDC__) || defined(__cplusplus) +#if (defined(__STDC__) || defined(__cplusplus) || defined(__BORLANDC__) || defined(_MSC_VER)) # define __ANSI_PROTO(x) x #else # define __ANSI_PROTO(x) () @@ -124,10 +128,11 @@ typedef struct result_s { #define IS_UNIQUE(n) (n & UNIQUE_FLAG) #define IS_NOT_NULL(n) (n & NOT_NULL_FLAG) +/* static char msqlTypeNames[][12] = {"???", "int", "char","real","ident","null","text","date","uint", "money","time","???"}; - +*/ /* ** Pre-declarations for the API library functions diff --git a/harbour/contrib/msql/dbf2msql.prg b/harbour/contrib/msql/tests/dbf2msql.prg similarity index 100% rename from harbour/contrib/msql/dbf2msql.prg rename to harbour/contrib/msql/tests/dbf2msql.prg diff --git a/harbour/contrib/msql/test.prg b/harbour/contrib/msql/tests/test.prg similarity index 100% rename from harbour/contrib/msql/test.prg rename to harbour/contrib/msql/tests/test.prg diff --git a/harbour/contrib/msql/tmsql.prg b/harbour/contrib/msql/tmsql.prg index 2554a4a940..8778e17808 100644 --- a/harbour/contrib/msql/tmsql.prg +++ b/harbour/contrib/msql/tmsql.prg @@ -111,11 +111,9 @@ METHOD FieldGet(nNum) CLASS TmSQLRow if nNum > 0 .AND. nNum <= Len(::aRow) return ::aRow[nNum] - else - return nil endif -return +return nil METHOD FieldPut(nNum, Value) CLASS TmSQLRow @@ -162,11 +160,9 @@ METHOD FieldName(nPosition) CLASS TmSQLRow if nPosition >=1 .AND. nPosition <= Len(::aFieldStruct) return ::aFieldStruct[nPosition][MSQL_FS_NAME] - else - return "" endif -return +return "" /* ----------------------------------------------------------------------------------------*/ @@ -270,7 +266,7 @@ static function NMonth(cMonthValue) static cMonths := {"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Ago", "Sep", "Oct", "Nov", "Dec" } - nMonth := AScan(cMonths, cMonthValue) + local nMonth := AScan(cMonths, cMonthValue) return PadL(nMonth, 2, "0") @@ -585,9 +581,7 @@ METHOD GetBlankRow() CLASS TmSQLTable endcase next - return TmSQLRow():New(aRow, ::aFieldStruct, ::cTable, .F.) - -return nil +return TmSQLRow():New(aRow, ::aFieldStruct, ::cTable, .F.) /* ----------------------------------------------------------------------------------------*/