From: <mie...@us...> - 2013-05-19 19:42:30
|
Revision: 9221 http://sourceforge.net/p/oorexx/code-0/9221 Author: miesfeld Date: 2013-05-19 19:42:27 +0000 (Sun, 19 May 2013) Log Message: ----------- ooSQLite - fix build for Linux Modified Paths: -------------- incubator/ooSQLite/Makefile.lin incubator/ooSQLite/examples/user.extensions/Makefile.lin incubator/ooSQLite/examples/user.extensions/autoPackages/Makefile.lin incubator/ooSQLite/examples/user.extensions/autoPackages/autoPackage1.cpp incubator/ooSQLite/examples/user.extensions/autoPackages/autoPackage2.cpp incubator/ooSQLite/examples/user.extensions/autoPackages/autoPackage3.cpp incubator/ooSQLite/examples/user.extensions/autoPackages/autoPackage4.cpp incubator/ooSQLite/examples/user.extensions/autoPackages/autoPackage5.cpp incubator/ooSQLite/examples/user.extensions/exampleLibrary.cpp incubator/ooSQLite/examples/user.extensions/examplePackage.cpp incubator/ooSQLite/src/ooSQLite.cpp incubator/ooSQLite/src/ooSQLite.hpp incubator/ooSQLite/src/oosqlPackage.hpp incubator/ooSQLite/src/platform/unix/SysLibrary.cpp incubator/ooSQLite/src/platform/unix/unixOS.hpp Modified: incubator/ooSQLite/Makefile.lin =================================================================== --- incubator/ooSQLite/Makefile.lin 2013-05-19 17:41:48 UTC (rev 9220) +++ incubator/ooSQLite/Makefile.lin 2013-05-19 19:42:27 UTC (rev 9221) @@ -98,7 +98,7 @@ OUT_DIR=build/release BIN_DIR=bin/linux -SYSLIB_FLAGS=-DORX_SHARED_LIBRARY_EXT=\".so\" +SYSLIB_FLAGS=-DOOSQLITE_SHARED_LIBRARY_EXT=\".so\" SO_LFLAGS=-D_REENTRANT=1 -shared -nostartfiles EXE_LFLAGS=-D_REENTRANT=1 @@ -115,19 +115,19 @@ $(OUT_DIR)/sqlite3.o: src/sqlite/sqlite3.c src/sqlite/sqlite3.h Makefile.lin - gcc $(CFLAGS) $(EXTRA_INCLUDE) -o $(OUT_DIR)/sqlite3.o src/sqlite/sqlite3.c + gcc $(CFLAGS) -DOOSQLITE_BUILD $(EXTRA_INCLUDE) -o $(OUT_DIR)/sqlite3.o src/sqlite/sqlite3.c $(OUT_DIR)/shell.o: src/sqlite/shell.c src/sqlite/sqlite3.h Makefile.lin gcc $(CFLAGS) $(EXTRA_INCLUDE) -o $(OUT_DIR)/shell.o src/sqlite/shell.c $(OUT_DIR)/ooSQLite.o: src/ooSQLite.cpp src/ooSQLite.hpp src/APICommon.hpp src/sqlite/sqlite3.h Makefile.lin - gcc $(CFLAGS) $(EXTRA_INCLUDE) -o $(OUT_DIR)/ooSQLite.o src/ooSQLite.cpp + gcc $(CFLAGS) -DOOSQLITE_BUILD $(EXTRA_INCLUDE) -o $(OUT_DIR)/ooSQLite.o src/ooSQLite.cpp $(OUT_DIR)/APICommon.o: src/APICommon.cpp src/APICommon.hpp Makefile.lin gcc $(CFLAGS) $(EXTRA_INCLUDE) -o $(OUT_DIR)/APICommon.o src/APICommon.cpp $(OUT_DIR)/SysLibrary.o: $(PLATFORM_DIR)/SysLibrary.cpp $(PLATFORM_DIR)/SysLibrary.hpp Makefile.lin - cl $(CFLAGS) $(EXTRA_INCLUDE) $(SYSLIB_FLAGS) -o $(OUT_DIR)/SysLibrary.o $(PLATFORM_DIR)/SysLibrary.cpp + gcc $(CFLAGS) $(EXTRA_INCLUDE) $(SYSLIB_FLAGS) -o $(OUT_DIR)/SysLibrary.o $(PLATFORM_DIR)/SysLibrary.cpp $(OUT_DIR)/liboosqlite.so: $(OOSQLITE_OBJS) gcc $(SO_LFLAGS) -o $(OUT_DIR)/liboosqlite.so $(OOSQLITE_OBJS) $(SO_LLIBS) @@ -148,7 +148,7 @@ @echo @echo Building example shared library \(libraries\) cd examples/user.extensions; make -f Makefile.lin - cd autoPackages; make -f Makefile.lin + cd examples/user.extensions/autoPackages; make -f Makefile.lin cd ../../../ dist: all @@ -162,11 +162,12 @@ rm -f $(BIN_DIR)/*.so $(BIN_DIR)/oosqlite3 $(BIN_DIR)/*.cls rm -f src/ooSQLite.ver.incl cd examples/user.extensions; make -f Makefile.lin clean - cd ../../ + cd examples/user.extensions/autoPackages; make -f Makefile.lin clean + cd ../../../ clean: rm -f $(OUT_DIR)/*.so $(OUT_DIR)/ooSQLite.o $(OUT_DIR)/APICommon.o $(OUT_DIR)/oosqlite3 cd examples/user.extensions; make -f Makefile.lin clean - cd autoPackages; make -f Makefile.lin clean + cd examples/user.extensions/autoPackages; make -f Makefile.lin clean cd ../../../ Modified: incubator/ooSQLite/examples/user.extensions/Makefile.lin =================================================================== --- incubator/ooSQLite/examples/user.extensions/Makefile.lin 2013-05-19 17:41:48 UTC (rev 9220) +++ incubator/ooSQLite/examples/user.extensions/Makefile.lin 2013-05-19 19:42:27 UTC (rev 9221) @@ -38,7 +38,7 @@ # Makefile for the user defined functions in native code on Linux. -EXTRAINCLUDE=-I ../../src/sqlite +EXTRAINCLUDE=-I ../../src -I ../../src/sqlite BASEFLAGS = $(EXTRAINCLUDE) -DNULL=1 @@ -57,14 +57,14 @@ libsimpleextension.so: simpleExtension.o gcc $(SO_LFLAGS) -o libsimpleextension.so simpleExtension.o $(SO_LLIBS) -examplePackage.o: examplePackage.c Makefile.lin - gcc $(CFLAGS) $(EXTRA_INCLUDE) -o examplePackage.o examplePackage.c +examplePackage.o: examplePackage.cpp Makefile.lin + gcc $(CFLAGS) $(EXTRA_INCLUDE) -o examplePackage.o examplePackage.cpp libexamplepackage.so: examplePackage.o gcc $(SO_LFLAGS) -o libexamplepackage.so examplePackage.o $(SO_LLIBS) -exampleLibrary.o: exampleLibrary.c Makefile.lin - gcc $(CFLAGS) $(EXTRA_INCLUDE) -o exampleLibrary.o exampleLibrary.c +exampleLibrary.o: exampleLibrary.cpp Makefile.lin + gcc $(CFLAGS) $(EXTRA_INCLUDE) -o exampleLibrary.o exampleLibrary.cpp libexamplelibrary.so: exampleLibrary.o gcc $(SO_LFLAGS) -o libexamplelibrary.so exampleLibrary.o $(SO_LLIBS) Modified: incubator/ooSQLite/examples/user.extensions/autoPackages/Makefile.lin =================================================================== --- incubator/ooSQLite/examples/user.extensions/autoPackages/Makefile.lin 2013-05-19 17:41:48 UTC (rev 9220) +++ incubator/ooSQLite/examples/user.extensions/autoPackages/Makefile.lin 2013-05-19 19:42:27 UTC (rev 9221) @@ -50,7 +50,7 @@ CFLAGS=-c -fPIC $(BASEFLAGS) # What we want to build. -all: libautopackage1.so libautopackage2.so libautopackage2.so libautopackage2.so libautopackage2.so +all: libautopackage1.so libautopackage2.so libautopackage3.so libautopackage4.so libautopackage5.so autoPackage1.o: autoPackage1.cpp Makefile.lin gcc $(CFLAGS) $(EXTRA_INCLUDE) -o autoPackage1.o autoPackage1.cpp Modified: incubator/ooSQLite/examples/user.extensions/autoPackages/autoPackage1.cpp =================================================================== --- incubator/ooSQLite/examples/user.extensions/autoPackages/autoPackage1.cpp 2013-05-19 17:41:48 UTC (rev 9220) +++ incubator/ooSQLite/examples/user.extensions/autoPackages/autoPackage1.cpp 2013-05-19 19:42:27 UTC (rev 9221) @@ -43,10 +43,9 @@ #ifdef _WIN32 #include <windows.h> -#else - #define NULL 0 #endif +#include <string.h> #include <stdio.h> /** Modified: incubator/ooSQLite/examples/user.extensions/autoPackages/autoPackage2.cpp =================================================================== --- incubator/ooSQLite/examples/user.extensions/autoPackages/autoPackage2.cpp 2013-05-19 17:41:48 UTC (rev 9220) +++ incubator/ooSQLite/examples/user.extensions/autoPackages/autoPackage2.cpp 2013-05-19 19:42:27 UTC (rev 9221) @@ -43,10 +43,9 @@ #ifdef _WIN32 #include <windows.h> -#else - #define NULL 0 #endif +#include <string.h> #include <stdio.h> // printf() if needed /** Modified: incubator/ooSQLite/examples/user.extensions/autoPackages/autoPackage3.cpp =================================================================== --- incubator/ooSQLite/examples/user.extensions/autoPackages/autoPackage3.cpp 2013-05-19 17:41:48 UTC (rev 9220) +++ incubator/ooSQLite/examples/user.extensions/autoPackages/autoPackage3.cpp 2013-05-19 19:42:27 UTC (rev 9221) @@ -55,10 +55,9 @@ #ifdef _WIN32 #include <windows.h> -#else - #define NULL 0 #endif +#include <string.h> #include <stdio.h> // printf() if needed /** Modified: incubator/ooSQLite/examples/user.extensions/autoPackages/autoPackage4.cpp =================================================================== --- incubator/ooSQLite/examples/user.extensions/autoPackages/autoPackage4.cpp 2013-05-19 17:41:48 UTC (rev 9220) +++ incubator/ooSQLite/examples/user.extensions/autoPackages/autoPackage4.cpp 2013-05-19 19:42:27 UTC (rev 9221) @@ -43,10 +43,9 @@ #ifdef _WIN32 #include <windows.h> -#else - #define NULL 0 #endif +#include <string.h> #include <stdio.h> // printf() if needed /** Modified: incubator/ooSQLite/examples/user.extensions/autoPackages/autoPackage5.cpp =================================================================== --- incubator/ooSQLite/examples/user.extensions/autoPackages/autoPackage5.cpp 2013-05-19 17:41:48 UTC (rev 9220) +++ incubator/ooSQLite/examples/user.extensions/autoPackages/autoPackage5.cpp 2013-05-19 19:42:27 UTC (rev 9221) @@ -55,10 +55,9 @@ #ifdef _WIN32 #include <windows.h> -#else - #define NULL 0 #endif +#include <string.h> #include <stdio.h> // printf() if needed /** Modified: incubator/ooSQLite/examples/user.extensions/exampleLibrary.cpp =================================================================== --- incubator/ooSQLite/examples/user.extensions/exampleLibrary.cpp 2013-05-19 17:41:48 UTC (rev 9220) +++ incubator/ooSQLite/examples/user.extensions/exampleLibrary.cpp 2013-05-19 19:42:27 UTC (rev 9221) @@ -66,6 +66,7 @@ #include <windows.h> #endif +#include <string.h> #include <stdio.h> // printf() if needed /** Modified: incubator/ooSQLite/examples/user.extensions/examplePackage.cpp =================================================================== --- incubator/ooSQLite/examples/user.extensions/examplePackage.cpp 2013-05-19 17:41:48 UTC (rev 9220) +++ incubator/ooSQLite/examples/user.extensions/examplePackage.cpp 2013-05-19 19:42:27 UTC (rev 9221) @@ -55,10 +55,9 @@ #ifdef _WIN32 #include <windows.h> -#else - #define NULL 0 #endif +#include <string.h> #include <stdio.h> // printf() if needed /** Modified: incubator/ooSQLite/src/ooSQLite.cpp =================================================================== --- incubator/ooSQLite/src/ooSQLite.cpp 2013-05-19 17:41:48 UTC (rev 9220) +++ incubator/ooSQLite/src/ooSQLite.cpp 2013-05-19 19:42:27 UTC (rev 9221) @@ -9390,7 +9390,8 @@ * * @note We expect fmt to have exactly 1 %s in it. */ -static void extensionsFormatLastErr(RexxMethodContext *c, pCooSQLExtensions pcext, uint32_t code, char *fmt, CSTRING insert) +static void extensionsFormatLastErr(RexxMethodContext *c, pCooSQLExtensions pcext, uint32_t code, CSTRING fmt, + CSTRING insert) { char buf[512]; @@ -9401,7 +9402,8 @@ extensionsSetLastErr(c, pcext->lastErrMsg, pcext->lastErrCode); } -static void extensionsFormatLastErr(RexxMethodContext *c, pCooSQLExtensions pcext, uint32_t code, char *fmt, RexxObjectPtr insert) +static void extensionsFormatLastErr(RexxMethodContext *c, pCooSQLExtensions pcext, uint32_t code, CSTRING fmt, + RexxObjectPtr insert) { extensionsFormatLastErr(c, pcext, code, fmt, c->ObjectToStringValue(insert)); } @@ -9473,7 +9475,7 @@ if ( pCsc->autoCollations == NULL ) { - pCsc->autoCollations = (pSQLiteCollationEntry *)LocalAlloc(LPTR, MAX_AUTO_COLLATIONS * sizeof(pSQLiteCollationEntry)); + pCsc->autoCollations = (pSQLiteCollationEntry *)sqlite3_malloc(MAX_AUTO_COLLATIONS * sizeof(pSQLiteCollationEntry)); if ( pCsc->autoCollations == NULL ) { outOfMemoryException(c->threadContext); @@ -9507,7 +9509,7 @@ if ( pCsc->autoFunctions == NULL ) { - pCsc->autoFunctions = (pSQLiteFunctionEntry *)LocalAlloc(LPTR, MAX_AUTO_FUNCTIONS * sizeof(pSQLiteFunctionEntry)); + pCsc->autoFunctions = (pSQLiteFunctionEntry *)sqlite3_malloc(MAX_AUTO_FUNCTIONS * sizeof(pSQLiteFunctionEntry)); if ( pCsc->autoFunctions == NULL ) { outOfMemoryException(c->threadContext); @@ -9540,7 +9542,7 @@ if ( pCsc->autoPackages == NULL ) { - pCsc->autoPackages = (pCooSQLPackage *)LocalAlloc(LPTR, MAX_AUTO_PACKAGES * sizeof(pCooSQLPackage)); + pCsc->autoPackages = (pCooSQLPackage *)sqlite3_malloc(MAX_AUTO_PACKAGES * sizeof(pCooSQLPackage)); if ( pCsc->autoPackages == NULL ) { outOfMemoryException(c->threadContext); @@ -9592,7 +9594,11 @@ */ RexxObjectPtr createCollationObject(RexxMethodContext *c, pSQLiteCollationEntry e) { - RexxObjectPtr result = TheNilObj; + RexxClassObject collationCls = NULLOBJECT; + RexxBufferObject collationCSelf = NULLOBJECT; + pSQLiteCollationEntry cpy = NULLOBJECT; + RexxObjectPtr collation = NULLOBJECT; + RexxObjectPtr result = TheNilObj; if ( e->entryCompare == NULL ) { @@ -9600,23 +9606,23 @@ goto done_out; } - RexxClassObject collationCls = rxGetContextClass(c, "ooSQLCollation"); + collationCls = rxGetContextClass(c, "ooSQLCollation"); if ( collationCls == NULLOBJECT ) { goto done_out; } - RexxBufferObject collationCSelf = c->NewBuffer(sizeof(SQLiteCollationEntry)); + collationCSelf = c->NewBuffer(sizeof(SQLiteCollationEntry)); if ( collationCSelf == NULLOBJECT ) { outOfMemoryException(c->threadContext); goto done_out; } - pSQLiteCollationEntry cpy = (pSQLiteCollationEntry)c->BufferData(collationCSelf); + cpy = (pSQLiteCollationEntry)c->BufferData(collationCSelf); memcpy(cpy, e, sizeof(SQLiteCollationEntry)); - RexxObjectPtr collation = c->SendMessage1(collationCls, "NEW", collationCSelf); + collation = c->SendMessage1(collationCls, "NEW", collationCSelf); if ( collation != NULLOBJECT ) { result = collation; @@ -9637,7 +9643,11 @@ */ RexxObjectPtr createFunctionObject(RexxMethodContext *c, pSQLiteFunctionEntry e) { - RexxObjectPtr result = TheNilObj; + RexxClassObject functionCls = NULLOBJECT; + RexxBufferObject functionCSelf = NULLOBJECT; + pSQLiteFunctionEntry cpy = NULLOBJECT; + RexxObjectPtr function = NULLOBJECT; + RexxObjectPtr result = TheNilObj; if ( e->entryFunc == NULL && e->entryStep == NULL && e->entryFinal == NULL ) { @@ -9645,23 +9655,23 @@ goto done_out; } - RexxClassObject functionCls = rxGetContextClass(c, "ooSQLFunction"); + functionCls = rxGetContextClass(c, "ooSQLFunction"); if ( functionCls == NULLOBJECT ) { goto done_out; } - RexxBufferObject functionCSelf = c->NewBuffer(sizeof(SQLiteFunctionEntry)); + functionCSelf = c->NewBuffer(sizeof(SQLiteFunctionEntry)); if ( functionCSelf == NULLOBJECT ) { outOfMemoryException(c->threadContext); goto done_out; } - pSQLiteFunctionEntry cpy = (pSQLiteFunctionEntry)c->BufferData(functionCSelf); + cpy = (pSQLiteFunctionEntry)c->BufferData(functionCSelf); memcpy(cpy, e, sizeof(SQLiteFunctionEntry)); - RexxObjectPtr function = c->SendMessage1(functionCls, "NEW", functionCSelf); + function = c->SendMessage1(functionCls, "NEW", functionCSelf); if ( function != NULLOBJECT ) { result = function; @@ -9800,23 +9810,26 @@ */ RexxMethod3(RexxObjectPtr, oosqlext_loadLibrary_cls, RexxObjectPtr, libName, OPTIONAL_RexxObjectPtr, procedures, CSELF, pCSelf) { - RexxMethodContext *c = context; - pCooSQLExtensions pcext = (pCooSQLExtensions)pCSelf; - RexxObjectPtr result = TheFalseObj; + pCooSQLExtensions pcext = (pCooSQLExtensions)pCSelf; - RexxClassObject libCls = rxGetContextClass(context, "ooSQLLibrary"); + RexxClassObject libCls = NULLOBJECT; + RexxObjectPtr library = NULLOBJECT; + pCooSQLLibrary pcl = NULLOBJECT; + RexxObjectPtr result = TheFalseObj; + + libCls = rxGetContextClass(context, "ooSQLLibrary"); if ( libCls == NULLOBJECT ) { goto done_out; } - RexxObjectPtr library = c->SendMessage1(libCls, "NEW", libName); + library = context->SendMessage1(libCls, "NEW", libName); if ( library == NULLOBJECT ) { goto done_out; } - pCooSQLLibrary pcl = (pCooSQLLibrary)context->ObjectToCSelf(library); + pcl = (pCooSQLLibrary)context->ObjectToCSelf(library); if ( pcl == NULL ) { extensionsFormatLastErr(context, pcext, OO_NO_CSELF, OO_NO_CSELF_STR, "ooSQLLibrary"); @@ -9835,24 +9848,24 @@ // If there is a sparse array exception, we will undo this. If there is an // error resolving a function address, we will set result to false, but keep // everything else as is up to that point. - c->SendMessage2(pcext->libraryTable, "PUT", library, c->String(pcl->baseName)); + context->SendMessage2(pcext->libraryTable, "PUT", library, context->String(pcl->baseName)); result = TheTrueObj; if ( argumentExists(2) ) { - if ( c->IsArray(procedures) ) + if ( context->IsArray(procedures) ) { RexxArrayObject names = (RexxArrayObject)procedures; - size_t count = c->ArrayItems(names); + size_t count = context->ArrayItems(names); for ( size_t i = 1; i <= count; i++ ) { - RexxObjectPtr rxName = c->ArrayAt(names, i); + RexxObjectPtr rxName = context->ArrayAt(names, i); if ( rxName == NULLOBJECT ) { - sparseArrayException(c->threadContext, 2, i); + sparseArrayException(context->threadContext, 2, i); - c->SendMessage1(pcext->libraryTable, "REMOVE", c->String(pcl->baseName)); + context->SendMessage1(pcext->libraryTable, "REMOVE", context->String(pcl->baseName)); result = TheFalseObj; pcl->lib->unload(); @@ -9916,10 +9929,13 @@ RexxMethod4(RexxObjectPtr, oosqlext_loadPackage_cls, CSTRING, libName, OPTIONAL_RexxObjectPtr, dbConn, OPTIONAL_logical_t, makeAuto, CSELF, pCSelf) { - RexxMethodContext *c = context; - RexxObjectPtr result = TheFalseObj; - pCooSQLExtensions pcext = (pCooSQLExtensions)pCSelf; + pCooSQLExtensions pcext = (pCooSQLExtensions)pCSelf; + RexxClassObject packageCls = NULLOBJECT; + RexxObjectPtr package = NULLOBJECT; + pCooSQLPackage pcp = NULLOBJECT; + RexxObjectPtr result = TheFalseObj; + resetExtensionsLastErr(context, pcext); pCooSQLiteConn pConn = NULL; @@ -9932,19 +9948,19 @@ } } - RexxClassObject packageCls = rxGetContextClass(context, "ooSQLPackage"); + packageCls = rxGetContextClass(context, "ooSQLPackage"); if ( packageCls == NULLOBJECT ) { goto done_out; } - RexxObjectPtr package = context->SendMessage1(packageCls, "NEW", context->String(libName)); + package = context->SendMessage1(packageCls, "NEW", context->String(libName)); if ( package == NULLOBJECT ) { goto done_out; } - pCooSQLPackage pcp = (pCooSQLPackage)c->ObjectToCSelf(package); + pcp = (pCooSQLPackage)context->ObjectToCSelf(package); if ( pcp == NULL ) { extensionsFormatLastErr(context, pcext, OO_NO_CSELF, OO_NO_CSELF_STR, "ooSQLPackage"); @@ -9965,7 +9981,7 @@ goto done_out; } - c->SendMessage2(pcext->packageTable, "PUT", package, c->String(pcp->packageEntry->packageName)); + context->SendMessage2(pcext->packageTable, "PUT", package, context->String(pcp->packageEntry->packageName)); if ( makeAuto ) { Modified: incubator/ooSQLite/src/ooSQLite.hpp =================================================================== --- incubator/ooSQLite/src/ooSQLite.hpp 2013-05-19 17:41:48 UTC (rev 9220) +++ incubator/ooSQLite/src/ooSQLite.hpp 2013-05-19 19:42:27 UTC (rev 9221) @@ -38,6 +38,8 @@ #ifndef ooSQLite_Included #define ooSQLite_Included +#include "oorexxapi.h" + #define NO_SQLITEEXT_H #include "oosqlPackage.hpp" @@ -47,13 +49,13 @@ #undef NEED_DLL_MAIN #include "SysLibrary.hpp" #else + #define NEED_CRIT_SECT #include "unixOS.hpp" + #undef NEED_CRIT_SECT #include "SysLibrary.hpp" #endif -#include "oorexxapi.h" - // The range of errors needs to be contiguous and not include any SQLite error // rc. The next SQLite error rc is 1034. #define OO_ERR_FIRST 1000 Modified: incubator/ooSQLite/src/oosqlPackage.hpp =================================================================== --- incubator/ooSQLite/src/oosqlPackage.hpp 2013-05-19 17:41:48 UTC (rev 9220) +++ incubator/ooSQLite/src/oosqlPackage.hpp 2013-05-19 19:42:27 UTC (rev 9221) @@ -66,6 +66,10 @@ BEGIN_EXTERN_C() +#ifndef _WIN32 +#define APIENTRY +#endif + #define OOSQLITEENTRY APIENTRY #define ooSQLiteEntry OOSQLITEENTRY Modified: incubator/ooSQLite/src/platform/unix/SysLibrary.cpp =================================================================== --- incubator/ooSQLite/src/platform/unix/SysLibrary.cpp 2013-05-19 17:41:48 UTC (rev 9220) +++ incubator/ooSQLite/src/platform/unix/SysLibrary.cpp 2013-05-19 19:42:27 UTC (rev 9221) @@ -43,8 +43,9 @@ * */ +#include "sqlite3.h" +#include <oorexxapi.h> #include "unixOS.hpp" -#include <oorexxapi.h> #include "SysLibrary.hpp" #include <stdlib.h> #include <string.h> @@ -108,7 +109,7 @@ if ( strlen(name) > MAX_LIBRARY_NAME_LENGTH ) { - char *fmt = "Library name: %s is too long"; + CSTRING fmt = "Library name: %s is too long"; lastErrMsg = (char *)malloc(strlen(name) + strlen(fmt) + 1); if ( lastErrMsg != NULL ) @@ -140,7 +141,7 @@ libraryHandle = dlopen(nameBuffer, RTLD_LAZY); if (libraryHandle == NULL) { - setLastErr(); + setLastErr(MODULE_NOT_FOUND_RC); return false; } } Modified: incubator/ooSQLite/src/platform/unix/unixOS.hpp =================================================================== --- incubator/ooSQLite/src/platform/unix/unixOS.hpp 2013-05-19 17:41:48 UTC (rev 9220) +++ incubator/ooSQLite/src/platform/unix/unixOS.hpp 2013-05-19 19:42:27 UTC (rev 9221) @@ -53,10 +53,12 @@ #define MODULE_NOT_FOUND_RC 126 #define PROCEDURE_NOT_FOUND_RC 127 +#ifdef NEED_CRIT_SECT sqlite3_mutex *crit_sec = (sqlite3_mutex *)0; #define CRITICAL_SECTION_ENTER sqlite3_mutex_enter(crit_sec); #define CRITICAL_SECTION_LEAVE sqlite3_mutex_leave(crit_sec); +#endif #define oosqlGetCurrentThreadId() pthread_self() |