#12 tuning mingw MXE configuration
authoradam <adamansky@gmail.com>
Wed, 24 Apr 2013 11:30:27 +0000 (18:30 +0700)
committeradam <adamansky@gmail.com>
Wed, 24 Apr 2013 11:30:27 +0000 (18:30 +0700)
17 files changed:
.gitignore
.idea/bashsupport_project.xml [new file with mode: 0644]
.npmignore
tcejdb/Makefile.in
tcejdb/bson.c
tcejdb/configure.ac
tcejdb/mxe/mxe-build.sh [new file with mode: 0755]
tcejdb/nbproject/configurations.xml
tcejdb/nbproject/project.xml
tcejdb/tcatest.c
tcejdb/tcejdb.iml
tcejdb/tcfdb.c
tcejdb/tcftest.c
tcejdb/tchdb.c
tcejdb/tcucodec.c
tcejdb/win32/platform.c
tcejdb/win32/platform.h

index 1d313af..fb70fb6 100644 (file)
@@ -14,6 +14,7 @@
 *.lib
 .dep.inc
 
+
 addressbook*
 autom4te.cache/
 config.log
@@ -22,6 +23,7 @@ config.status
 /npm-debug.log
 /.idea/workspace.xml
 
+/tcejdb/tools/win32
 /tcejdb/Makefile
 /tcejdb/libtcejdb.a
 /tcejdb/libtcejdb.so
diff --git a/.idea/bashsupport_project.xml b/.idea/bashsupport_project.xml
new file mode 100644 (file)
index 0000000..0cbf55a
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="BashSupportProjectSettings">
+    <option name="globalVariables">
+      <set>
+        <option value="CONFLAGS" />
+      </set>
+    </option>
+  </component>
+</project>
+
index 8776e34..c1b22d2 100644 (file)
@@ -10,6 +10,7 @@ nbproject/
 /.idea
 /tcejdb/static
 
+/tcejdb/tools
 /tcejdb/doc
 /tcejdb/deb
 /tcejdb/Makefile
index cf2fe04..2a98a83 100644 (file)
@@ -733,7 +733,7 @@ tcejdbdll.dll libtcejdbdll.a tcejdbdll.def : $(LIBOBJFILES)
              $(LIBOBJFILES) $(LDFLAGS) $(LIBS)
 
 tcejdbdll.lib tcejdbdll.exp : tcejdbdll.dll libtcejdbdll.a tcejdbdll.def
-       lib /def:tcejdbdll.def
+       wine tools/win32/lib.exe /def:tcejdbdll.def
 
 
 tcutest : tcutest.o $(LIBRARYFILES)
index 9c68ead..b64a726 100644 (file)
@@ -283,7 +283,7 @@ void bson_print_raw(const char *data, int depth) {
                 /* bson_init( &scope ); */ /* review - stepped on by bson_iterator_code_scope? */
                 bson_iterator_code_scope(&i, &scope);
                 fprintf(f, "\n\t SCOPE: ");
-                bson_print_raw(&scope, 0);
+                bson_print_raw((const char*) &scope, 0);
                 /* bson_destroy( &scope ); */ /* review - causes free error */
                 break;
             case BSON_INT:
index a93ea4f..050a051 100644 (file)
@@ -38,7 +38,8 @@ MYPCFILES="tcejdb.pc"
 case $host_os in
   mingw*)
     #durty hack fixes weird behaviour of gcc -O[123] optimizations with ejdb test cases on win32
-    CCOPT=`gcc -O2 -Q --help=optimizers | grep enabled | sed 's/\[[enabled\]]//' | tr '\n' ' ' | sed 's/[[[:blank:]]]\+/ /g'`
+    #CCOPT=`gcc -O2 -Q --help=optimizers | grep enabled | sed 's/\[[enabled\]]//' | tr '\n' ' ' | sed 's/[[[:blank:]]]\+/ /g'`
+    CCOPT="-O2"
       ;;
   *)
     CCOPT="-O3"
@@ -78,7 +79,7 @@ AC_ARG_ENABLE(debug,
   AC_HELP_STRING([--enable-debug], [build for debugging]))
 if test "$enable_debug" = "yes"
 then
-  MYCFLAGS="-std=gnu99 -Wall -pedantic -fsigned-char -g -O0 -Wfatal-errors -Werror"
+  MYCFLAGS="-std=gnu99 -Wall -pedantic -fsigned-char -g -O0 -Wfatal-errors"
   MYCPPFLAGS="$MYCPPFLAGS -D_DEBUG -UNDEBUG -DEJDB_STATIC"
   MYCMDLDFLAGS="$MYCMDLDFLAGS -static"
   enables="$enables (debug)"
@@ -360,10 +361,11 @@ case $host_os in
         AC_CHECK_HEADER(pcreposix.h, true, AC_MSG_ERROR([pcreposix.h is required]))
         AC_CHECK_LIB(pcre, pcre_compile, [], AC_MSG_ERROR([pcre lib is required]))
         AC_CHECK_LIB(pcreposix, regcomp, [], AC_MSG_ERROR([pcreposix lib is required]))
-        AC_CHECK_LIB(pthreadGC2, main, [], AC_MSG_ERROR([pthreadGC2 lubrary is required]))
+        AC_CHECK_LIB(winpthread, main, [], AC_MSG_ERROR([winpthread lubrary is required]))
         MYLDFLAGS="-static-libgcc -static-libstdc++ $MYLDFLAGS -Wl,-Bstatic"
         MYHEADERFILES="$MYHEADERFILES win32/platform.h"
-        MYCPPFLAGS="$MYCPPFLAGS -DPCRE_STATIC -DPTW32_STATIC_LIB"
+        MYCPPFLAGS="$MYCPPFLAGS -DPCRE_STATIC -D__USE_MINGW_ANSI_STDIO"
+        MYCFLAGS="$MYCFLAGS -Wno-pedantic-ms-format"
         ;;
     *)
         MYHEADERFILES="$MYHEADERFILES nix/platform.h"
diff --git a/tcejdb/mxe/mxe-build.sh b/tcejdb/mxe/mxe-build.sh
new file mode 100755 (executable)
index 0000000..4ab26ea
--- /dev/null
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+TCEJDB_HOME=$(cd $(dirname ${0})/..; pwd -P)
+MXE_HOME=$(cd ${1}; pwd -P)
+
+(test -d ${MXE_HOME}/usr/bin) || { echo "Invalid MXE_HOME: ${1}"; exit 1; }
+shift
+
+if [ "${1}" = "w32" ]; then
+    HOST="i686-w64-mingw32"
+elif [ "${1}" = "w64" ]; then
+    HOST="x86_64-w64-mingw32"
+else
+    echo "Unknown target: ${1}. Must be one of: w32|w64";
+    exit 1;
+fi
+shift
+CONFLAGS="${1}"
+
+echo "TCEJDB_HOME=${TCEJDB_HOME}"
+echo "MXE_HOME=${MXE_HOME}"
+echo "HOST=${HOST}"
+
+PREFIX=${TCEJDB_HOME}/${HOST}
+export PATH=${MXE_HOME}/usr/bin:${MXE_HOME}/usr/${HOST}/bin:${PATH};
+unset CC CFLAGS CPPFLAGS LDFLAGS LD_LIBRARY_PATH
+
+cd ${TCEJDB_HOME}
+
+WINTOOLS=${TCEJDB_HOME}/tools/win32
+if [ ! -d ${WINTOOLS} ] || [ ! -r  ${WINTOOLS}/lib.exe ]; then
+  which wine || { echo "'wine' is not found! Please install 'wine'"; exit 1; }
+  which wget || { echo "'wget' is not found! Please install 'wget'"; exit 1; }
+  mkdir -p ${WINTOOLS} || exit 1
+  wget -O ${WINTOOLS}/lib.exe https://dl.dropboxusercontent.com/u/4709222/windev/lib.exe || exit 1
+  wget -O ${WINTOOLS}/link.exe https://dl.dropboxusercontent.com/u/4709222/windev/link.exe || exit 1
+  wget -O ${WINTOOLS}/mspdb100.dll https://dl.dropboxusercontent.com/u/4709222/windev/mspdb100.dll || exit 1
+fi
+
+export WINEDEBUG=fixme-all
+
+set -x
+autoconf
+./configure --host="${HOST}" --prefix=${PREFIX} ${CONFLAGS}
+make clean
+make
+
+
index 2695f47..3e015ca 100644 (file)
@@ -1,9 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<configurationDescriptor version="84">
+<configurationDescriptor version="88">
   <logicalFolder name="root" displayName="root" projectFiles="true" kind="ROOT">
-    <df name="tcejdb" root=".">
-      <df name="autom4te.cache">
-      </df>
+    <df root="." name="tcejdb">
       <df name="bros">
         <in>bdbtest.c</in>
         <in>cdbtest.c</in>
         <in>tctest.c</in>
         <in>tdbtest.c</in>
       </df>
-      <df name="debian">
-        <df name="libtcejdb9">
-          <df name="DEBIAN">
-          </df>
-          <df name="usr">
-            <df name="lib">
-              <df name="x86_64-linux-gnu">
-              </df>
-            </df>
-            <df name="share">
-              <df name="doc">
-                <df name="libtcejdb9">
-                </df>
-              </df>
-              <df name="lintian">
-                <df name="overrides">
-                </df>
-              </df>
-            </df>
-          </df>
-        </df>
-        <df name="libtcejdb9-dbg">
-          <df name="DEBIAN">
-          </df>
-          <df name="usr">
-            <df name="lib">
-              <df name="debug">
-              </df>
-            </df>
-            <df name="share">
-              <df name="doc">
-                <df name="libtcejdb9-dbg">
-                </df>
-              </df>
-              <df name="lintian">
-                <df name="overrides">
-                </df>
-              </df>
-            </df>
-          </df>
-        </df>
-        <df name="libtcejdb9-dev">
-          <df name="DEBIAN">
-          </df>
-          <df name="usr">
-            <df name="include">
-              <df name="tcejdb">
-                <in>bson.h</in>
-                <in>ejdb.h</in>
-                <in>ejdb_private.h</in>
-                <in>myconf.h</in>
-                <in>tcadb.h</in>
-                <in>tcbdb.h</in>
-                <in>tcfdb.h</in>
-                <in>tchdb.h</in>
-                <in>tctdb.h</in>
-                <in>tcutil.h</in>
-              </df>
-            </df>
-            <df name="lib">
-              <df name="x86_64-linux-gnu">
-                <df name="pkgconfig">
-                </df>
-              </df>
-            </df>
-            <df name="share">
-              <df name="doc">
-                <df name="libtcejdb9-dev">
-                </df>
-              </df>
-              <df name="lintian">
-                <df name="overrides">
-                </df>
-              </df>
-              <df name="man">
-                <df name="man3">
-                </df>
-              </df>
-            </df>
-          </df>
-        </df>
-        <df name="source">
-        </df>
-        <df name="tmp">
-          <df name="usr">
-            <df name="include">
-              <df name="tcejdb">
-                <in>bson.h</in>
-                <in>ejdb.h</in>
-                <in>ejdb_private.h</in>
-                <in>myconf.h</in>
-                <in>tcadb.h</in>
-                <in>tcbdb.h</in>
-                <in>tcfdb.h</in>
-                <in>tchdb.h</in>
-                <in>tctdb.h</in>
-                <in>tcutil.h</in>
-              </df>
-            </df>
-            <df name="lib">
-              <df name="x86_64-linux-gnu">
-                <df name="pkgconfig">
-                </df>
-              </df>
-            </df>
-            <df name="share">
-              <df name="man">
-                <df name="man3">
-                </df>
-              </df>
-              <df name="tcejdb">
-              </df>
-            </df>
-          </df>
-        </df>
-      </df>
-      <df name="doc">
-      </df>
-      <df name="lab">
-      </df>
-      <df name="man">
+      <df name="nix">
+        <in>platform.h</in>
       </df>
       <df name="samples">
         <df name="sample1">
           <in>sample1.c</in>
         </df>
       </df>
-      <df name="static">
-      </df>
       <df name="testejdb">
         <in>t1.c</in>
         <in>t2.c</in>
         <in>t3.c</in>
         <in>t4.c</in>
       </df>
+      <in>basedefs.h</in>
       <in>bson.c</in>
       <in>bson.h</in>
       <in>ejdb.c</in>
       <toolsSet>
         <remote-sources-mode>LOCAL_SOURCES</remote-sources-mode>
         <compilerSet>default</compilerSet>
+        <dependencyChecking>false</dependencyChecking>
+        <rebuildPropChanged>false</rebuildPropChanged>
       </toolsSet>
       <codeAssistance>
       </codeAssistance>
           <buildCommandWorkingDir>.</buildCommandWorkingDir>
           <buildCommand>${MAKE} -f Makefile</buildCommand>
           <cleanCommand>${MAKE} -f Makefile clean</cleanCommand>
-          <executablePath>libtcejdb.so.9.11.0</executablePath>
+          <executablePath>tcfmttest</executablePath>
           <cTool>
-            <incDir>
-              <pElem>../../../../include</pElem>
-              <pElem>.</pElem>
-              <pElem>/usr/local/include</pElem>
-            </incDir>
             <preprocessorList>
               <Elem>_GNU_SOURCE=1</Elem>
               <Elem>_REENTRANT</Elem>
           </cTool>
         </makeTool>
       </makefileType>
+      <item path="basedefs.h" ex="false" tool="3" flavor2="0">
+      </item>
       <item path="bros/bdbtest.c" ex="false" tool="0" flavor2="2">
         <cTool>
         </cTool>
       </item>
       <item path="bson.c" ex="false" tool="0" flavor2="2">
         <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
         </cTool>
       </item>
+      <item path="bson.h" ex="false" tool="3" flavor2="0">
+      </item>
       <item path="ejdb.c" ex="false" tool="0" flavor2="2">
         <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
           <preprocessorList>
             <Elem>_MYTESTS</Elem>
           </preprocessorList>
         </cTool>
       </item>
+      <item path="ejdb.h" ex="false" tool="3" flavor2="0">
+      </item>
+      <item path="ejdb_private.h" ex="false" tool="3" flavor2="0">
+      </item>
       <item path="ejdbutl.c" ex="false" tool="0" flavor2="2">
         <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
         </cTool>
       </item>
+      <item path="ejdbutl.h" ex="false" tool="3" flavor2="0">
+      </item>
       <item path="encoding.c" ex="false" tool="0" flavor2="2">
         <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
           <preprocessorList>
             <Elem>NDEBUG</Elem>
             <Elem>_TC_APPLIBS="-L/usr/local/lib -ltcejdb -lbz2 -lz -lrt -lpthread -lm -lc "</Elem>
           </preprocessorList>
         </cTool>
       </item>
+      <item path="encoding.h" ex="false" tool="3" flavor2="0">
+      </item>
+      <folder path="tcejdb/bros">
+        <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
+        </cTool>
+      </folder>
       <folder path="tcejdb/samples">
         <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
           <preprocessorList>
             <Elem>_TC_APPLIBS="-L/usr/local/lib -ltokyocabinet -lbz2 -lz -lrt -lpthread -lm -lc "</Elem>
           </preprocessorList>
       </folder>
       <folder path="tcejdb/testejdb">
         <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
           <preprocessorList>
             <Elem>_TC_APPLIBS="-L/usr/local/lib -ltokyocabinet -lbz2 -lz -lrt -lpthread -lm -lc "</Elem>
           </preprocessorList>
       </folder>
       <item path="md5.c" ex="false" tool="0" flavor2="2">
         <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
           <preprocessorList>
             <Elem>NDEBUG</Elem>
             <Elem>_TC_APPLIBS="-L/usr/local/lib -ltcejdb -lbz2 -lz -lrt -lpthread -lm -lc "</Elem>
           </preprocessorList>
         </cTool>
       </item>
+      <item path="md5.h" ex="false" tool="3" flavor2="0">
+      </item>
       <item path="myconf.c" ex="false" tool="0" flavor2="2">
         <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
           <preprocessorList>
             <Elem>NDEBUG</Elem>
             <Elem>_TC_APPLIBS="-L/usr/local/lib -ltcejdb -lbz2 -lz -lrt -lpthread -lm -lc "</Elem>
           </preprocessorList>
         </cTool>
       </item>
+      <item path="myconf.h" ex="false" tool="3" flavor2="0">
+      </item>
+      <item path="nix/platform.h" ex="false" tool="3" flavor2="0">
+      </item>
       <item path="numbers.c" ex="false" tool="0" flavor2="2">
         <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
           <preprocessorList>
             <Elem>NDEBUG</Elem>
             <Elem>_TC_APPLIBS="-L/usr/local/lib -ltcejdb -lbz2 -lz -lrt -lpthread -lm -lc "</Elem>
       </item>
       <item path="tcadb.c" ex="false" tool="0" flavor2="2">
         <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
         </cTool>
       </item>
+      <item path="tcadb.h" ex="false" tool="3" flavor2="0">
+      </item>
       <item path="tcamgr.c" ex="false" tool="0" flavor2="2">
         <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
         </cTool>
       </item>
       <item path="tcamttest.c" ex="false" tool="0" flavor2="2">
         <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
         </cTool>
       </item>
       <item path="tcatest.c" ex="false" tool="0" flavor2="2">
         <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
         </cTool>
       </item>
       <item path="tcawmgr.c" ex="false" tool="0" flavor2="2">
         <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
         </cTool>
       </item>
       <item path="tcbdb.c" ex="false" tool="0" flavor2="2">
         <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
         </cTool>
       </item>
+      <item path="tcbdb.h" ex="false" tool="3" flavor2="0">
+      </item>
       <item path="tcbmgr.c" ex="false" tool="0" flavor2="2">
         <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
         </cTool>
       </item>
       <item path="tcbmttest.c" ex="false" tool="0" flavor2="2">
         <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
         </cTool>
       </item>
       <item path="tcbtest.c" ex="false" tool="0" flavor2="2">
         <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
         </cTool>
       </item>
       <item path="tcfdb.c" ex="false" tool="0" flavor2="2">
         <cTool>
+          <incDir>
+            <pElem>.</pElem>
+            <pElem>../../../../include</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
+          <preprocessorList>
+            <Elem>EJDB_STATIC</Elem>
+            <Elem>_DEBUG</Elem>
+            <Elem>_MYTESTS</Elem>
+            <Elem>_TC_APPLIBS="-L/usr/local/lib -lpthread -lz -lrt -lm -lc "</Elem>
+          </preprocessorList>
         </cTool>
       </item>
+      <item path="tcfdb.h" ex="false" tool="3" flavor2="0">
+      </item>
       <item path="tcfmgr.c" ex="false" tool="0" flavor2="2">
         <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
         </cTool>
       </item>
       <item path="tcfmttest.c" ex="false" tool="0" flavor2="2">
         <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
         </cTool>
       </item>
       <item path="tcftest.c" ex="false" tool="0" flavor2="2">
         <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
         </cTool>
       </item>
       <item path="tchdb.c" ex="false" tool="0" flavor2="2">
         <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
         </cTool>
       </item>
+      <item path="tchdb.h" ex="false" tool="3" flavor2="0">
+      </item>
       <item path="tchmgr.c" ex="false" tool="0" flavor2="2">
         <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
         </cTool>
       </item>
       <item path="tchmttest.c" ex="false" tool="0" flavor2="2">
         <cTool>
+          <incDir>
+            <pElem>.</pElem>
+            <pElem>../../../../include</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
+          <preprocessorList>
+            <Elem>EJDB_STATIC</Elem>
+            <Elem>_DEBUG</Elem>
+            <Elem>_MYTESTS</Elem>
+            <Elem>_TC_APPLIBS="-L/usr/local/lib -lpthread -lz -lrt -lm -lc "</Elem>
+          </preprocessorList>
         </cTool>
       </item>
       <item path="tchtest.c" ex="false" tool="0" flavor2="2">
         <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
         </cTool>
       </item>
       <item path="tctdb.c" ex="false" tool="0" flavor2="2">
         <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
         </cTool>
       </item>
+      <item path="tctdb.h" ex="false" tool="3" flavor2="0">
+      </item>
       <item path="tctmgr.c" ex="false" tool="0" flavor2="2">
         <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
         </cTool>
       </item>
       <item path="tctmttest.c" ex="false" tool="0" flavor2="2">
         <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
         </cTool>
       </item>
       <item path="tcttest.c" ex="false" tool="0" flavor2="2">
         <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
         </cTool>
       </item>
       <item path="tcucodec.c" ex="false" tool="0" flavor2="2">
         <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
         </cTool>
       </item>
       <item path="tcumttest.c" ex="false" tool="0" flavor2="2">
         <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
           <preprocessorList>
             <Elem>NDEBUG</Elem>
             <Elem>_TC_APPLIBS="-L/usr/local/lib -ltcejdb -lbz2 -lz -lrt -lpthread -lm -lc "</Elem>
       </item>
       <item path="tcutest.c" ex="false" tool="0" flavor2="2">
         <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
         </cTool>
       </item>
       <item path="tcutil.c" ex="false" tool="0" flavor2="2">
         <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
         </cTool>
       </item>
+      <item path="tcutil.h" ex="false" tool="3" flavor2="0">
+      </item>
       <item path="testejdb/t1.c" ex="false" tool="0" flavor2="2">
         <cTool>
         </cTool>
         <cTool>
         </cTool>
       </item>
+      <item path="testejdb/t4.c" ex="false" tool="0" flavor2="2">
+        <cTool>
+        </cTool>
+      </item>
       <item path="utf8proc.c" ex="false" tool="0" flavor2="2">
         <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
           <preprocessorList>
             <Elem>_TC_APPLIBS="-L/usr/local/lib -ltcejdb -lbz2 -lz -lrt -lpthread -lm -lc "</Elem>
           </preprocessorList>
         </cTool>
       </item>
+      <item path="utf8proc.h" ex="false" tool="3" flavor2="0">
+      </item>
       <item path="utf8proc_data.c" ex="false" tool="0" flavor2="2">
         <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
+          <preprocessorList>
+            <Elem>_TC_APPLIBS="-L/usr/local/lib -ltcejdb -lbz2 -lz -lrt -lpthread -lm -lc "</Elem>
+          </preprocessorList>
+        </cTool>
+      </item>
+    </conf>
+    <conf name="Win32" type="0">
+      <toolsSet>
+        <remote-sources-mode>LOCAL_SOURCES</remote-sources-mode>
+        <compilerSet>default</compilerSet>
+        <dependencyChecking>false</dependencyChecking>
+        <rebuildPropChanged>false</rebuildPropChanged>
+      </toolsSet>
+      <codeAssistance>
+      </codeAssistance>
+      <makefileType>
+        <makeTool>
+          <buildCommandWorkingDir>.</buildCommandWorkingDir>
+          <buildCommand>${MAKE} -f Makefile</buildCommand>
+          <cleanCommand>${MAKE} -f Makefile clean</cleanCommand>
+          <executablePath>tcfmttest</executablePath>
+          <cTool>
+            <preprocessorList>
+              <Elem>WIN32</Elem>
+              <Elem>_GNU_SOURCE=1</Elem>
+              <Elem>_REENTRANT</Elem>
+              <Elem>_TC_APPINC="-I/usr/local/include"</Elem>
+              <Elem>_TC_APPLIBS="-L/usr/local/lib -ltcejdb -lz -lrt -lpthread -lm -lc "</Elem>
+              <Elem>_TC_BINDIR="/usr/local/bin"</Elem>
+              <Elem>_TC_INCLUDEDIR="/usr/local/include"</Elem>
+              <Elem>_TC_LIBDIR="/usr/local/lib"</Elem>
+              <Elem>_TC_LIBEXECDIR="/usr/local/libexec"</Elem>
+              <Elem>_TC_PREFIX="/usr/local"</Elem>
+              <Elem>_UNICODE</Elem>
+              <Elem>_WIN32</Elem>
+              <Elem>__EXTENSIONS__</Elem>
+            </preprocessorList>
+          </cTool>
+        </makeTool>
+      </makefileType>
+      <item path="basedefs.h" ex="false" tool="3" flavor2="0">
+      </item>
+      <item path="bros/bdbtest.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+        </cTool>
+      </item>
+      <item path="bros/cdbtest.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+        </cTool>
+      </item>
+      <item path="bros/cmpsqltctest.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+        </cTool>
+      </item>
+      <item path="bros/gdbmtest.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+        </cTool>
+      </item>
+      <item path="bros/maptest.cc" ex="false" tool="1" flavor2="0">
+        <ccTool>
+        </ccTool>
+      </item>
+      <item path="bros/ndbmtest.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+        </cTool>
+      </item>
+      <item path="bros/qdbmtest.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+        </cTool>
+      </item>
+      <item path="bros/sdbmtest.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+        </cTool>
+      </item>
+      <item path="bros/sqltest.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+        </cTool>
+      </item>
+      <item path="bros/tctest.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+        </cTool>
+      </item>
+      <item path="bros/tdbtest.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+        </cTool>
+      </item>
+      <item path="bson.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
+        </cTool>
+      </item>
+      <item path="bson.h" ex="false" tool="3" flavor2="0">
+      </item>
+      <item path="ejdb.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
+          <preprocessorList>
+            <Elem>_MYTESTS</Elem>
+          </preprocessorList>
+        </cTool>
+      </item>
+      <item path="ejdb.h" ex="false" tool="3" flavor2="0">
+      </item>
+      <item path="ejdb_private.h" ex="false" tool="3" flavor2="0">
+      </item>
+      <item path="ejdbutl.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
+        </cTool>
+      </item>
+      <item path="ejdbutl.h" ex="false" tool="3" flavor2="0">
+      </item>
+      <item path="encoding.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
+          <preprocessorList>
+            <Elem>NDEBUG</Elem>
+            <Elem>_TC_APPLIBS="-L/usr/local/lib -ltcejdb -lbz2 -lz -lrt -lpthread -lm -lc "</Elem>
+          </preprocessorList>
+        </cTool>
+      </item>
+      <item path="encoding.h" ex="false" tool="3" flavor2="0">
+      </item>
+      <folder path="tcejdb/bros">
+        <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
+        </cTool>
+      </folder>
+      <folder path="tcejdb/samples">
+        <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
+          <preprocessorList>
+            <Elem>_TC_APPLIBS="-L/usr/local/lib -ltokyocabinet -lbz2 -lz -lrt -lpthread -lm -lc "</Elem>
+          </preprocessorList>
+        </cTool>
+      </folder>
+      <folder path="tcejdb/testejdb">
+        <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
+          <preprocessorList>
+            <Elem>_TC_APPLIBS="-L/usr/local/lib -ltokyocabinet -lbz2 -lz -lrt -lpthread -lm -lc "</Elem>
+          </preprocessorList>
+        </cTool>
+      </folder>
+      <item path="md5.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
+          <preprocessorList>
+            <Elem>NDEBUG</Elem>
+            <Elem>_TC_APPLIBS="-L/usr/local/lib -ltcejdb -lbz2 -lz -lrt -lpthread -lm -lc "</Elem>
+          </preprocessorList>
+        </cTool>
+      </item>
+      <item path="md5.h" ex="false" tool="3" flavor2="0">
+      </item>
+      <item path="myconf.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
+          <preprocessorList>
+            <Elem>NDEBUG</Elem>
+            <Elem>_TC_APPLIBS="-L/usr/local/lib -ltcejdb -lbz2 -lz -lrt -lpthread -lm -lc "</Elem>
+          </preprocessorList>
+        </cTool>
+      </item>
+      <item path="myconf.h" ex="false" tool="3" flavor2="0">
+      </item>
+      <item path="nix/platform.h" ex="false" tool="3" flavor2="0">
+      </item>
+      <item path="numbers.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
+          <preprocessorList>
+            <Elem>NDEBUG</Elem>
+            <Elem>_TC_APPLIBS="-L/usr/local/lib -ltcejdb -lbz2 -lz -lrt -lpthread -lm -lc "</Elem>
+          </preprocessorList>
+        </cTool>
+      </item>
+      <item path="samples/sample1/sample1.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+        </cTool>
+      </item>
+      <item path="tcadb.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
+        </cTool>
+      </item>
+      <item path="tcadb.h" ex="false" tool="3" flavor2="0">
+      </item>
+      <item path="tcamgr.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
+        </cTool>
+      </item>
+      <item path="tcamttest.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
+        </cTool>
+      </item>
+      <item path="tcatest.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
+        </cTool>
+      </item>
+      <item path="tcawmgr.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
+        </cTool>
+      </item>
+      <item path="tcbdb.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
+        </cTool>
+      </item>
+      <item path="tcbdb.h" ex="false" tool="3" flavor2="0">
+      </item>
+      <item path="tcbmgr.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
+        </cTool>
+      </item>
+      <item path="tcbmttest.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
+        </cTool>
+      </item>
+      <item path="tcbtest.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
+        </cTool>
+      </item>
+      <item path="tcfdb.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+          <incDir>
+            <pElem>.</pElem>
+            <pElem>../../../../include</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
+          <preprocessorList>
+            <Elem>EJDB_STATIC</Elem>
+            <Elem>_DEBUG</Elem>
+            <Elem>_MYTESTS</Elem>
+            <Elem>_TC_APPLIBS="-L/usr/local/lib -lpthread -lz -lrt -lm -lc "</Elem>
+          </preprocessorList>
+        </cTool>
+      </item>
+      <item path="tcfdb.h" ex="false" tool="3" flavor2="0">
+      </item>
+      <item path="tcfmgr.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
+        </cTool>
+      </item>
+      <item path="tcfmttest.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
+        </cTool>
+      </item>
+      <item path="tcftest.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
+        </cTool>
+      </item>
+      <item path="tchdb.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
+        </cTool>
+      </item>
+      <item path="tchdb.h" ex="false" tool="3" flavor2="0">
+      </item>
+      <item path="tchmgr.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
+        </cTool>
+      </item>
+      <item path="tchmttest.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+          <incDir>
+            <pElem>.</pElem>
+            <pElem>../../../../include</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
+          <preprocessorList>
+            <Elem>EJDB_STATIC</Elem>
+            <Elem>_DEBUG</Elem>
+            <Elem>_MYTESTS</Elem>
+            <Elem>_TC_APPLIBS="-L/usr/local/lib -lpthread -lz -lrt -lm -lc "</Elem>
+          </preprocessorList>
+        </cTool>
+      </item>
+      <item path="tchtest.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
+        </cTool>
+      </item>
+      <item path="tctdb.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
+        </cTool>
+      </item>
+      <item path="tctdb.h" ex="false" tool="3" flavor2="0">
+      </item>
+      <item path="tctmgr.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
+        </cTool>
+      </item>
+      <item path="tctmttest.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
+        </cTool>
+      </item>
+      <item path="tcttest.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
+        </cTool>
+      </item>
+      <item path="tcucodec.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
+        </cTool>
+      </item>
+      <item path="tcumttest.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
+          <preprocessorList>
+            <Elem>NDEBUG</Elem>
+            <Elem>_TC_APPLIBS="-L/usr/local/lib -ltcejdb -lbz2 -lz -lrt -lpthread -lm -lc "</Elem>
+          </preprocessorList>
+        </cTool>
+      </item>
+      <item path="tcutest.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
+        </cTool>
+      </item>
+      <item path="tcutil.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
+        </cTool>
+      </item>
+      <item path="tcutil.h" ex="false" tool="3" flavor2="0">
+      </item>
+      <item path="testejdb/t1.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+        </cTool>
+      </item>
+      <item path="testejdb/t2.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+        </cTool>
+      </item>
+      <item path="testejdb/t3.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+        </cTool>
+      </item>
+      <item path="testejdb/t4.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+        </cTool>
+      </item>
+      <item path="utf8proc.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
+          <preprocessorList>
+            <Elem>_TC_APPLIBS="-L/usr/local/lib -ltcejdb -lbz2 -lz -lrt -lpthread -lm -lc "</Elem>
+          </preprocessorList>
+        </cTool>
+      </item>
+      <item path="utf8proc.h" ex="false" tool="3" flavor2="0">
+      </item>
+      <item path="utf8proc_data.c" ex="false" tool="0" flavor2="0">
+        <cTool>
+          <incDir>
+            <pElem>../../../../include</pElem>
+            <pElem>.</pElem>
+            <pElem>/usr/local/include</pElem>
+          </incDir>
           <preprocessorList>
             <Elem>_TC_APPLIBS="-L/usr/local/lib -ltcejdb -lbz2 -lz -lrt -lpthread -lm -lc "</Elem>
           </preprocessorList>
index 66bf57a..ea6e1a1 100644 (file)
@@ -5,7 +5,7 @@
         <data xmlns="http://www.netbeans.org/ns/make-project/1">
             <name>tcejdb</name>
             <c-extensions>c</c-extensions>
-            <cpp-extensions>cc</cpp-extensions>
+            <cpp-extensions>cc,cpp</cpp-extensions>
             <header-extensions>h</header-extensions>
             <sourceEncoding>UTF-8</sourceEncoding>
             <make-dep-projects/>
                     <name>Default</name>
                     <type>0</type>
                 </confElem>
+                <confElem>
+                    <name>Win32</name>
+                    <type>0</type>
+                </confElem>
             </confList>
         </data>
     </configuration>
index 77849d9..2601f95 100644 (file)
@@ -145,7 +145,7 @@ static void eprint(TCADB *adb, int line, const char *func) {
             "ERROR:%s:%d:%s:%s:%d:%s:%d:%s\n",
             g_progname, line,
             func, (path ? path : "-"),
-            winerrno, (errorText ? errorText : "-"),
+            (int) winerrno, (errorText ? errorText : "-"),
             stderrno, (stderrno > 0 ? strerror(stderrno) : "-"));
     if (errorText) LocalFree(errorText);
 #else
index 9f9a6f2..931a98b 100644 (file)
@@ -6,6 +6,7 @@
     <content url="file://$MODULE_DIR$">
       <excludeFolder url="file://$MODULE_DIR$/nbproject" />
     </content>
+    <content url="file://$USER_HOME$/tmp/tokyocabinet-win" />
     <orderEntry type="jdk" jdkName="1.7" jdkType="JavaSDK" />
     <orderEntry type="sourceFolder" forTests="false" />
   </component>
index 362707a..9102fb2 100644 (file)
@@ -1144,7 +1144,7 @@ void tcfdbsetecode(TCFDB *fdb, int ecode, const char *filename, int line, const
                 filename, line,
                 func, (fdb->path ? fdb->path : "-"),
                 ecode, tcfdberrmsg(ecode),
-                winerrno, (errorText ? errorText : "-"),
+                (int) winerrno, (errorText ? errorText : "-"),
                 stderrno, (stderrno > 0 ? strerror(stderrno) : "-"));
         if (errorText) LocalFree(errorText);
 #else
@@ -1192,7 +1192,7 @@ bool tcfdbmemsync(TCFDB *fdb, bool phys) {
     memcpy((void *) fdb->map, hbuf, FDBOPAQUEOFF);
     if (phys) {
 #ifdef _WIN32
-        if (!FlushViewOfFile((PCVOID) fdb->map, 0)) {
+        if (!FlushViewOfFile((LPCVOID) fdb->map, 0)) {
             tcfdbsetecode(fdb, TCEMMAP, __FILE__, __LINE__, __func__);
             err = true;
         }
@@ -2035,8 +2035,8 @@ static bool tcfdbcloseimpl(TCFDB *fdb) {
     if (fdb->map == NULL || munmap(fdb->map, fdb->limsiz)) {
 #else
     if (fdb->map) {
-        FlushViewOfFile((PCVOID) fdb->map, 0);
-        UnmapViewOfFile((LPVOID) fdb->map);
+        FlushViewOfFile((LPCVOID) fdb->map, 0);
+        UnmapViewOfFile((LPCVOID) fdb->map);
         CLOSEFH2(fdb->w32hmap);
         fdb->w32hmap = INVALID_HANDLE_VALUE;
     } else {
@@ -3033,7 +3033,7 @@ static bool tcfdbftruncate2(TCFDB *fdb, off_t length, int opts) {
         size.QuadPart = fdb->limsiz;
     }
     if (fdb->map) {
-        FlushViewOfFile((PCVOID) fdb->map, 0);
+        FlushViewOfFile((LPCVOID) fdb->map, 0);
         if (!UnmapViewOfFile((LPCVOID) fdb->map) || !CloseHandle(fdb->w32hmap)) {
             tcfdbsetecode(fdb, TCEMMAP, __FILE__, __LINE__, __func__);
             err = true;
@@ -3108,7 +3108,6 @@ void tcfdbprintmeta(TCFDB *fdb) {
     wp += sprintf(wp, " rsiz=%u", fdb->rsiz);
     wp += sprintf(wp, " limid=%" PRIuMAX "", (uint64_t) fdb->limid);
     wp += sprintf(wp, " path=%s", fdb->path ? fdb->path : "-");
-    wp += sprintf(wp, " fd=%d", fdb->fd);
     wp += sprintf(wp, " omode=%u", fdb->omode);
     wp += sprintf(wp, " rnum=%" PRIuMAX "", (uint64_t) fdb->rnum);
     wp += sprintf(wp, " fsiz=%" PRIuMAX "", (uint64_t) fdb->fsiz);
@@ -3120,10 +3119,13 @@ void tcfdbprintmeta(TCFDB *fdb) {
     wp += sprintf(wp, " fatal=%u", fdb->fatal);
     wp += sprintf(wp, " inode=%" PRIuMAX "", (uint64_t) fdb->inode);
     wp += sprintf(wp, " mtime=%" PRIuMAX "", (uint64_t) fdb->mtime);
+    wp += sprintf(wp, " walend=%" PRIuMAX "", (uint64_t) fdb->walend);
     wp += sprintf(wp, " tran=%d", fdb->tran);
+#ifndef _WIN32
+    wp += sprintf(wp, " fd=%d", fdb->fd);
     wp += sprintf(wp, " walfd=%d", fdb->walfd);
-    wp += sprintf(wp, " walend=%" PRIuMAX "", (uint64_t) fdb->walend);
     wp += sprintf(wp, " dbgfd=%d", fdb->dbgfd);
+#endif    
 #ifndef NDEBUG
     wp += sprintf(wp, " cnt_writerec=%" PRIdMAX "", (int64_t) fdb->cnt_writerec);
     wp += sprintf(wp, " cnt_readrec=%" PRIdMAX "", (int64_t) fdb->cnt_readrec);
index 3b392a8..c5a89e8 100644 (file)
@@ -159,7 +159,7 @@ static void eprint(TCFDB *fdb, int line, const char *func) {
             g_progname, path ? path : "-",
             line, func,
             ecode, tcfdberrmsg(ecode),
-            myerrno, errorText ? errorText : "-",
+            (int) myerrno, errorText ? errorText : "-",
             stderrno, strerror(stderrno));
 
     if (errorText) LocalFree(errorText);
index 4752ae6..813c1aa 100644 (file)
@@ -1392,7 +1392,7 @@ void tchdbsetecode(TCHDB *hdb, int ecode, const char *filename, int line, const
                 filename, line,
                 func, (hdb->path ? hdb->path : "-"),
                 ecode, tchdberrmsg(ecode),
-                winerrno, (errorText ? errorText : "-"),
+                (int) winerrno, (errorText ? errorText : "-"),
                 stderrno, (stderrno > 0 ? strerror(stderrno) : "-"));
         if (errorText) LocalFree(errorText);
 #else
@@ -1450,7 +1450,7 @@ bool tchdbmemsync(TCHDB *hdb, bool phys) {
     if (phys) {
         if (!HDBLOCKSMEM(hdb, false)) return false;
 #ifdef _WIN32
-        if (!hdb->map || !FlushViewOfFile((PCVOID) hdb->map, 0)) {
+        if (!hdb->map || !FlushViewOfFile((LPCVOID) hdb->map, 0)) {
             tchdbsetecode(hdb, TCEMMAP, __FILE__, __LINE__, __func__);
             err = true;
         }
@@ -3703,7 +3703,7 @@ static bool tchdbopenimpl(TCHDB *hdb, const char *path, int omode) {
             TCFREE(hdb->fbpool);
             if (hdb->map) {
 #ifdef _WIN32
-                FlushViewOfFile((PCVOID) hdb->map, 0);
+                FlushViewOfFile((LPCVOID) hdb->map, 0);
                 UnmapViewOfFile((LPCVOID) hdb->map);
                 CLOSEFH2(hdb->w32hmap);
 #else
@@ -3754,8 +3754,8 @@ static bool tchdbcloseimpl(TCHDB *hdb) {
     if (!hdb->map || munmap(hdb->map, xmsiz)) {
 #else
     if (hdb->map) {
-        FlushViewOfFile((PCVOID) hdb->map, 0);
-        UnmapViewOfFile((LPVOID) hdb->map);
+        FlushViewOfFile((LPCVOID) hdb->map, 0);
+        UnmapViewOfFile((LPCVOID) hdb->map);
         CloseHandle(hdb->w32hmap);
         hdb->w32hmap = INVALID_HANDLE_VALUE;
     } else {
@@ -5424,7 +5424,7 @@ static bool tchdbftruncate2(TCHDB *hdb, off_t length, int opts) {
         size.QuadPart = MAX(o1, o2);
     }
     if (hdb->map) {
-        FlushViewOfFile((PCVOID) hdb->map, 0);
+        FlushViewOfFile((LPCVOID) hdb->map, 0);
         if (!UnmapViewOfFile((LPCVOID) hdb->map) || !CloseHandle(hdb->w32hmap)) {
             tchdbsetecode(hdb, TCEMMAP, __FILE__, __LINE__, __func__);
             err = true;
@@ -5500,7 +5500,6 @@ void tchdbprintmeta(TCHDB *hdb) {
     wp += sprintf(wp, " fpow=%u", hdb->fpow);
     wp += sprintf(wp, " opts=%u", hdb->opts);
     wp += sprintf(wp, " path=%s", hdb->path ? hdb->path : "-");
-    wp += sprintf(wp, " fd=%d", hdb->fd);
     wp += sprintf(wp, " omode=%u", hdb->omode);
     wp += sprintf(wp, " rnum=%" PRIuMAX "", (uint64_t) hdb->rnum);
     wp += sprintf(wp, " fsiz=%" PRIuMAX "", (uint64_t) hdb->fsiz);
@@ -5529,9 +5528,12 @@ void tchdbprintmeta(TCHDB *hdb) {
     wp += sprintf(wp, " dfunit=%u", hdb->dfunit);
     wp += sprintf(wp, " dfcnt=%u", hdb->dfcnt);
     wp += sprintf(wp, " tran=%d", hdb->tran);
-    wp += sprintf(wp, " walfd=%d", hdb->walfd);
     wp += sprintf(wp, " walend=%" PRIuMAX "", (uint64_t) hdb->walend);
+#ifndef _WIN32
+    wp += sprintf(wp, " fd=%d", hdb->fd);
+    wp += sprintf(wp, " walfd=%d", hdb->walfd);
     wp += sprintf(wp, " dbgfd=%d", hdb->dbgfd);
+#endif
 
 #ifndef NDEBUG
     wp += sprintf(wp, " cnt_writerec=%" PRIdMAX "", (int64_t) hdb->cnt_writerec);
index 3400e29..0868fe0 100644 (file)
@@ -1296,8 +1296,8 @@ static int procconf(int mode) {
             printf("macro(P_tmpdir): %s\n", P_tmpdir);
             printf("sysconf(_SC_OPEN_MAX): %ld\n", sysconf(_SC_OPEN_MAX));
 #endif
-            printf("sysconf(_SC_CLK_TCK): %ld\n", sysconf_SC_CLK_TCK);
-            printf("sysconf(_SC_PAGESIZE): %ld\n", tcpagsize());
+            printf("sysconf(_SC_CLK_TCK): %ld\n", (long int) sysconf_SC_CLK_TCK);
+            printf("sysconf(_SC_PAGESIZE): %ld\n", (long int) tcpagsize());
             TCMAP *info = tcsysinfo();
             if (info) {
                 tcmapiterinit(info);
index ff63ef6..e394202 100644 (file)
@@ -2,30 +2,6 @@
 #include "../tcutil.h"
 #include "../myconf.h"
 
-struct tm *gmtime_r(const time_t *timep, struct tm *result) {
-    static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
-    pthread_mutex_lock(&mutex);
-    struct tm *cas = gmtime(timep);
-    pthread_mutex_unlock(&mutex);
-    if (result == NULL || cas == NULL) {
-        return NULL;
-    }
-    memcpy(result, cas, sizeof (struct tm));
-    return result;
-}
-
-struct tm *localtime_r(const time_t *timep, struct tm *result) {
-    static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
-    pthread_mutex_lock(&mutex);
-    struct tm *cas = localtime(timep);
-    pthread_mutex_unlock(&mutex);
-    if (result == NULL || cas == NULL) {
-        return NULL;
-    }
-    memcpy(result, cas, sizeof (struct tm));
-    return result;
-}
-
 static int file_attr_to_st_mode(DWORD attr) {
     int fMode = S_IREAD;
     if (attr & FILE_ATTRIBUTE_DIRECTORY)
@@ -166,8 +142,7 @@ int glob(const char *pattern, int flags,
     return 0;
 }
 
-#ifdef EJDB_DLL
-
+#if defined(EJDB_DLL) && defined(PTW32_VERSION)
 BOOL WINAPI DllMain(HINSTANCE hinstDll, DWORD fdwReason, LPVOID lpvReserved) {
     BOOL result = PTW32_TRUE;
     switch (fdwReason) {
index a6304e9..a27e087 100644 (file)
@@ -41,8 +41,6 @@ typedef struct {
 
 int glob(const char *pattern, int flags, int (*errfunc) (const char *epath, int eerrno), glob_t *pglob);
 void globfree(glob_t *pglob);
-struct tm *gmtime_r(const time_t *timep, struct tm *result);
-struct tm *localtime_r(const time_t *timep, struct tm *result);
 int win_fstat(HANDLE fh, struct stat *buf);
 ssize_t win_pwrite(HANDLE fd, const void *buf, size_t count, off_t offset);
 ssize_t win_pread(HANDLE fd, void *buf, size_t size, off_t off);