Version 5.4.3.2, tag libreoffice-5.4.3.2
[LibreOffice.git] / external / firebird / firebird-cygwin-msvc.patch
blob658580415ab5a8c09db0915230b19ec262c4a03b
1 --- src/include/firebird.h 2016-07-15 11:31:27.151443500 +0200
2 +++ src/include/firebird.h 2016-07-17 14:50:04.043792400 +0200
3 @@ -32,11 +32,7 @@
4 #ifndef INCLUDE_Firebird_H
5 #define INCLUDE_Firebird_H
7 -#ifdef _MSC_VER
8 -#include "gen/autoconfig_msvc.h"
9 -#else
10 #include "gen/autoconfig.h"
11 -#endif
13 // Using our debugging code is pointless when we may use Valgrind features
14 #if defined(DEV_BUILD) && !defined(USE_VALGRIND)
15 --- src/misc/writeBuildNum.sh 2016-07-07 15:57:04.538983200 +0200
16 +++ src/misc/writeBuildNum.sh 2016-07-13 11:31:18.132820200 +0200
17 @@ -95,9 +95,9 @@
18 createMakeVersion() {
20 OdsH="${Root}/src/jrd/ods.h"
21 -Mini="/tmp/miniods.h"
22 -TestCpp="/tmp/test.cpp"
23 -AOut="/tmp/a.out"
24 +Mini=$(cygpath -m "/tmp/miniods.h")
25 +TestCpp=$(cygpath -m "/tmp/test.cpp")
26 +AOut=$(cygpath -m "/tmp/a.out")
28 grep ODS_VERSION $OdsH | grep -v ENCODE_ODS >$Mini
30 --- builds/make.new/config/config.h.in 2016-07-07 15:55:55.693112800 +0200
31 +++ builds/make.new/config/config.h.in 2016-07-08 13:38:49.994986400 +0200
32 @@ -396,7 +396,7 @@
33 #undef HAVE_SIGSET
35 /* Define to 1 if you have the `snprintf' function. */
36 -#undef HAVE_SNPRINTF
37 +#define HAVE_SNPRINTF
39 /* Define to 1 if you have the <socket.h> header file. */
40 #undef HAVE_SOCKET_H
41 @@ -551,7 +551,7 @@
42 #undef HAVE_VFORK_H
44 /* Define to 1 if you have the `vsnprintf' function. */
45 -#undef HAVE_VSNPRINTF
46 +#define HAVE_VSNPRINTF
48 /* Define to 1 if you have the <winsock2.h> header file. */
49 #undef HAVE_WINSOCK2_H
50 @@ -646,7 +646,7 @@
51 #undef TIME_WITH_SYS_TIME
53 /* Define this if OS is Windows NT */
54 -#undef WIN_NT
55 +#define WIN_NT
57 /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
58 significant byte first (like Motorola and SPARC, unlike Intel). */
59 @@ -703,3 +703,34 @@
60 #ifndef HAVE_SOCKLEN_T
61 typedef int socklen_t;
62 #endif
64 +/* taken from src/include/gen/autoconfig_msvc.h */
65 +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
66 +/* target architecture */
67 +#if defined(_M_IX86)
68 +/* sizeof(void *) */
69 +#define SIZEOF_VOID_P 4
70 +/* sizeof(size_t) */
71 +#define SIZEOF_SIZE_T 4
72 +/* alignment of long */
73 +#define FB_ALIGNMENT 4
74 +#elif defined(_M_AMD64)
75 +#define AMD64
76 +/* sizeof(void *) */
77 +#define SIZEOF_VOID_P 8
78 +/* sizeof(size_t) */
79 +#define SIZEOF_SIZE_T 8
80 +/* alignment of long */
81 +#define FB_ALIGNMENT 8
82 +#else
83 +#error unknown target platform
84 +#endif
86 +#define HAVE_IO_H
88 +#define HAVE_GETPAGESIZE
90 +#if defined _MSC_VER
91 +#define isnan _isnan
92 +#endif
94 --- src/common/common.h 2016-07-15 11:31:26.366735500 +0200
95 +++ src/common/common.h 2016-07-17 16:18:39.121579400 +0200
96 @@ -551,15 +551,6 @@
97 #endif /* WIN_NT */
100 -#ifndef FB_CPU
101 -#error Define FB_CPU for your platform
102 -#endif
103 -#ifndef FB_OS
104 -#error Define FB_OS for your platform
105 -#endif
106 -#ifndef FB_CC
107 -#error Define FB_CC for your platform
108 -#endif
111 /*****************************************************
112 diff -ur builds/posix/make.defaults builds/posix/make.defaults
113 --- builds/posix/make.defaults 2016-07-07 13:56:13.036235166 +0200
114 +++ builds/posix/make.defaults 2016-07-07 14:29:52.368289242 +0200
115 @@ -55,7 +55,11 @@
116 else
117 FIREBIRD=$(FB_BUILD)
118 endif
119 -FIREBIRD_LOCK=$(FIREBIRD)
120 +ifeq (@PLATFORM@,win32)
121 + FIREBIRD_LOCK=$(shell cygpath -w $(FIREBIRD) )
122 +else
123 + FIREBIRD_LOCK=$(FIREBIRD)
124 +endif
126 export FIREBIRD
127 export FIREBIRD_LOCK
128 @@ -152,7 +156,11 @@
129 CD= cd
130 CAT= cat
131 AR= ar @AR_OPTIONS@
132 -LN= @LN_S@
133 +ifeq (@PLATFORM@,win32)
134 + LN= cp
135 +else
136 + LN= @LN_S@
137 +endif
138 RANLIB= @RANLIB@
139 BTYACC=$(ROOT)/extern/btyacc/btyacc
140 CLOOP=$(GEN_ROOT)/$(TARGET)/cloop/release/bin/cloop
141 @@ -174,10 +182,10 @@
143 # Default extensions
145 -ARCH_EXT= .a
146 +ARCH_EXT= .lib
147 EXEC_EXT= @EXEEXT@
148 SHRLIB_EXT=@SHRLIB_EXT@
149 -LIB_PREFIX= lib
150 +LIB_PREFIX=
151 SHRLIB_FOREIGN_EXT= $(SHRLIB_EXT)
153 #_____________________________________________________________________________
154 @@ -203,6 +211,7 @@
155 vpath %.so $(LIB)
156 vpath %.a $(LIB)
157 vpath %.dll $(LIB)
158 +vpath %.lib $(LIB)
160 #_____________________________________________________________________________
162 @@ -216,9 +225,9 @@
165 #LibraryFileName=libfbclient
166 -LibraryFileName=libfbclient
167 -LibraryFullName=$(LibraryFileName).${SHRLIB_EXT}.${FirebirdVersion}
168 -LibrarySoName=$(LibraryFileName).${SHRLIB_EXT}.2
169 +LibraryFileName=ifbclient
170 +LibraryFullName=$(LibraryFileName).${SHRLIB_EXT}
171 +LibrarySoName=$(LibraryFileName).${SHRLIB_EXT}
172 LibraryBaseName=$(LibraryFileName).${SHRLIB_EXT}
174 LIBFIREBIRD_FULLNAME = $(LIB)/$(LibraryFullName)
175 @@ -227,7 +236,7 @@
177 # The firebird engine library name
179 -EngineFileName=libEngine${OdsVersion}
180 +EngineFileName=Engine12
181 EngineSoName=$(EngineFileName).${SHRLIB_EXT}
182 ENGINE_SONAME = $(PLUGINS)/$(EngineSoName)
184 @@ -241,7 +250,7 @@
185 ifeq ($(STD_EDITLINE), true)
186 LIBEDITLINE := -l$(READLINE)
187 else
188 - LIBEDITLINE := $(LIB)/libedit.a
189 + LIBEDITLINE := $(LIB)/edit.lib
190 endif
191 endif
193 @@ -289,7 +298,7 @@
194 LIB_PATH_OPTS = $(call LIB_LINK_RPATH,lib) $(call LIB_LINK_RPATH,intl)
195 LIB_LINK_SONAME= -Wl,-soname,$(1)
196 LIB_LINK_MAPFILE= -Wl,--version-script,$(1)
197 -FIREBIRD_LIBRARY_LINK= -L$(LIB) -lfbclient $(MATHLIB)
198 +FIREBIRD_LIBRARY_LINK= -L$(LIB) -lifbclient $(MATHLIB)
200 EXE_LINK_OPTIONS= $(LDFLAGS) $(THR_FLAGS) $(UNDEF_FLAGS) $(LIB_PATH_OPTS) $(LINK_EMPTY_SYMBOLS)
201 LIB_LINK_OPTIONS= $(LDFLAGS) $(THR_FLAGS) -shared
202 @@ -329,7 +338,8 @@
204 # Pay attention - we place common library into obj, not lib dir
205 # It's just a set of object files, prepared to be used by ld, not an output library
206 -COMMON_LIB = $(OBJ)/common.a
208 +COMMON_LIB = $(OBJ)/common.lib
210 # From utilities
211 CREATE_DB = $(RBIN)/create_db$(EXEC_EXT)
212 --- builds/posix/Makefile.in 2016-07-07 15:56:06.459221300 +0200
213 +++ builds/posix/Makefile.in 2016-07-13 12:44:57.134217200 +0200
214 @@ -33,7 +33,8 @@
215 # Alex Peshkoff - created single makefile based on Mark's files
218 -ROOT=$(shell cd ..; pwd)
219 +#ROOT=$(shell cd ..; pwd)
220 +ROOT=$(shell cygpath -m '$(shell cd ..; pwd)')
222 include make.defaults
223 ifeq ($(CROSS_OUT), Y)
224 @@ -163,7 +164,7 @@
225 .PHONY: cross1 cross2 boot yvalve engine fbintl gpre utilities plugins rest codes ids examples cross_rest
227 master_process:
228 - ln -sf $(SRC_ROOT)/include/gen/autoconfig.auto $(SRC_ROOT)/include/gen/autoconfig.h
229 + cp -f $(SRC_ROOT)/include/gen/autoconfig.auto $(SRC_ROOT)/include/gen/autoconfig.h
230 $(MAKE) updateBuildNum
231 $(MAKE) export_lists
232 $(MAKE) extern
233 @@ -186,10 +187,10 @@
234 (cd $(BIN); $(LN) $(notdir $(GPRE)) $(notdir $(GPRE_CURRENT)))
235 ifeq ($(IsDeveloper), Y)
236 # In developer mode we must regenerate various files in include/gen
237 - $(MAKE) codes
238 +# $(MAKE) codes
239 endif
240 - $(MAKE) plugins
241 - $(MAKE) examples
242 +# $(MAKE) plugins
243 + $(MAKE) include_generic
244 $(MAKE) rest
247 @@ -198,7 +199,7 @@
248 $(MAKE) CROSS_OUT=Y cross2
250 cross1:
251 - ln -sf $(SRC_ROOT)/include/gen/autoconfig.auto $(SRC_ROOT)/include/gen/autoconfig.h
252 + cp -f $(SRC_ROOT)/include/gen/autoconfig.auto $(SRC_ROOT)/include/gen/autoconfig.h
253 $(MAKE) updateBuildNum
254 $(MAKE) export_lists
255 $(MAKE) extern
256 @@ -223,7 +224,7 @@
257 $(MAKE) -f Makefile.examples -C $(GEN_ROOT)/examples/
259 cross2:
260 - ln -sf $(SRC_ROOT)/include/cross/$(CROSS_CONFIG) $(SRC_ROOT)/include/gen/autoconfig.h
261 + cp -f $(SRC_ROOT)/include/cross/$(CROSS_CONFIG) $(SRC_ROOT)/include/gen/autoconfig.h
262 $(MAKE) prerequisites
263 $(MAKE) tommath
264 $(MAKE) yvalve
265 @@ -275,7 +275,8 @@
267 # remote redirector is statically linked in main FB library
268 $(LIBFIREBIRD_FULLNAME): $(YValve_Objects) $(Remote_Client_Objects) $(COMMON_LIB)
269 - $(LINK_FIREBIRD) -o $@ $^ $(LINK_FIREBIRD_LIBS)
270 + @echo 'compile: $(LINK_FIREBIRD) $(CPPFLAGS) -o $@ $^ $(LINK_FIREBIRD_LIBS)'
271 + $(LINK_FIREBIRD) $(CPPFLAGS) -o $@ $^ $(LINK_FIREBIRD_LIBS)
274 #___________________________________________________________________________
275 @@ -284,7 +286,8 @@
276 engine: $(ENGINE_SONAME)
278 $(ENGINE_SONAME): $(Engine_Objects) $(SVC_Objects) $(COMMON_LIB)
279 - $(LINK_ENGINE) -o $@ $^ $(LINK_ENGINE_LIBS)
280 + @echo 'compile engine: $(LINK_ENGINE) $(CPPFLAGS) -o $@ $^ $(LINK_ENGINE_LIBS)'
281 + $(LINK_ENGINE) $(CPPFLAGS) -o $@ $^ $(YValve_Objects) $(Remote_Client_Objects) $(LINK_ENGINE_LIBS)
284 #___________________________________________________________________________
285 @@ -294,7 +297,7 @@
286 fbintl: $(LIBFBINTL_SO)
288 $(LIBFBINTL_SO): $(INTL_Objects) $(COMMON_LIB)
289 - $(LINK_INTL) -o $@ $^ $(LINK_INTL_LIBS)
290 + $(LINK_INTL) $(CPPFLAGS) -o $@ $^ $(YValve_Objects) $(Remote_Client_Objects) $(LINK_INTL_LIBS)
293 #___________________________________________________________________________
294 @@ -393,7 +396,7 @@
296 .PHONY: firebird_server fb_lock_print fbguard fbsvcmgr fbtracemgr gbak gfix gsec gsplit gstat isql nbackup
298 -utilities: firebird_server fb_lock_print fbguard fbsvcmgr fbtracemgr gbak gfix gsec gsplit gstat isql nbackup udfsupport
299 +utilities: gbak gfix isql
301 firebird_server: $(FB_DAEMON)
303 @@ -540,7 +543,7 @@
304 GBAK_FILES := $(FDB_FILES:.fdb=.gbak) $(FIREBIRD)/msg.gbak
305 GBAK_FILES := $(subst Native,$(TARGET),$(GBAK_FILES))
307 -rest: qli message_file
308 +rest: message_file
310 cross_rest: qli gbak_files
311 $(MAKE) $(BUILD_FILE)
312 @@ -593,7 +595,7 @@
313 IBASE_ExtraFiles = include/types_pub.h include/consts_pub.h dsql/sqlda_pub.h common/dsc_pub.h jrd/ibase.h jrd/inf_pub.h jrd/blr.h include/gen/iberror.h
314 SRC_IBASE_ExtraFiles = $(addprefix $(SRC_ROOT)/, $(IBASE_ExtraFiles))
315 MAKE_HEADER_Src = $(addprefix $(SRC_ROOT)/, misc/makeHeader.cpp)
316 -MAKE_HEADER_Bin = ./makeHeader
317 +MAKE_HEADER_Bin = ./makeHeader.exe
319 $(INCLUDE_DEST)/ibase.h: $(SRC_IBASE_ExtraFiles)
320 $(STATICEXE_LINK) -o $(MAKE_HEADER_Bin) $(MAKE_HEADER_Src)
321 diff -ur builds/posix/Makefile.in.examples builds/posix/Makefile.in.examples
322 --- builds/posix/Makefile.in.examples 2016-07-07 13:56:13.048235166 +0200
323 +++ builds/posix/Makefile.in.examples 2016-07-07 14:37:36.904301682 +0200
324 @@ -65,10 +65,13 @@
325 EXAMPLES_DEST= $(GEN_ROOT)/examples
326 EXAMPLES_SRC= $(ROOT)/examples
329 +ifeq ($(PLATFORM),win32)
330 +EMPBLD_Objects= $(EXAMPLES_DEST)/empbuild.obj
331 +INTLBLD_Objects= $(EXAMPLES_DEST)/intlbld.obj
332 +else
333 EMPBLD_Objects= $(EXAMPLES_DEST)/empbuild.o
335 INTLBLD_Objects= $(EXAMPLES_DEST)/intlbld.o
336 +endif
338 INPUT_Files = empddl.sql empdml.sql indexoff.sql indexon.sql \
339 job.inp lang.inp proj.inp qtr.inp
340 @@ -172,3 +175,5 @@
342 $(EXAMPLES_DEST)/%.h: $(EXAMPLES_SRC)/common/%.h
343 $(CP) $^ $@
344 +$(EXAMPLES_DEST)/%.obj: $(EXAMPLES_DEST)/%.c
345 + $(CC) -c $(firstword $<) -Fo$@ $(WCFLAGS)
346 diff -ur builds/posix/make.rules builds/posix/make.rules
347 --- builds/posix/make.rules 2016-07-07 13:56:13.036235166 +0200
348 +++ builds/posix/make.rules 2016-07-07 14:31:16.116291485 +0200
349 @@ -88,22 +88,20 @@
351 $(OBJ)/%.o: $(SRC_ROOT)/%.c
352 $(CC) $(WCFLAGS) -c $(firstword $<) -o $@
353 - @sed $(INLINE_EDIT_SED) -e "1,2s/:/: \$$(wildcard/" -e "\$$s/\(.*\)/\\1)/" $(patsubst %.o,%.d,$@)
355 $(OBJ)/%.o: $(OBJ)/%.cpp
356 $(CXX) $(WCXXFLAGS) -c $(firstword $<) -o $@
357 - @sed $(INLINE_EDIT_SED) -e "1,2s/:/: \$$(wildcard/" -e "\$$s/\(.*\)/\\1)/" $(patsubst %.o,%.d,$@)
359 $(OBJ)/%.o: $(SRC_ROOT)/%.cpp
360 $(CXX) $(WCXXFLAGS) -c $(firstword $<) -o $@
361 - @sed $(INLINE_EDIT_SED) -e "1,2s/:/: \$$(wildcard/" -e "\$$s/\(.*\)/\\1)/" $(patsubst %.o,%.d,$@)
363 .SUFFIXES: .epp .e
365 # Rules for making resource files
367 $(GEN_ROOT)/%.res: $(SRC_ROOT)/%.rc
368 - windres --output-format=coff --include-dir=$(<D) $< $@
369 + mkdir -p $(@D)
370 + rc.exe $(SOLARINC) /fo $@ $<
372 # Rule for making gbak files when cross-compiling
374 --- src/common/utils.cpp 2016-07-15 11:31:26.746871100 +0200
375 +++ src/common/utils.cpp 2016-07-19 19:14:45.370689300 +0200
376 @@ -880,15 +880,15 @@
377 FILETIME utime, stime, dummy;
378 if (GetProcessTimes(GetCurrentProcess(), &dummy, &dummy, &stime, &utime))
380 - LARGE_INTEGER lint;
381 + LARGE_INTEGER myLargeInt;
383 - lint.HighPart = stime.dwHighDateTime;
384 - lint.LowPart = stime.dwLowDateTime;
385 - sysTime = lint.QuadPart / 10000;
387 - lint.HighPart = utime.dwHighDateTime;
388 - lint.LowPart = utime.dwLowDateTime;
389 - userTime = lint.QuadPart / 10000;
390 + myLargeInt.HighPart = stime.dwHighDateTime;
391 + myLargeInt.LowPart = stime.dwLowDateTime;
392 + sysTime = myLargeInt.QuadPart / 10000;
394 + myLargeInt.HighPart = utime.dwHighDateTime;
395 + myLargeInt.LowPart = utime.dwLowDateTime;
396 + userTime = myLargeInt.QuadPart / 10000;
398 else
400 diff -ur builds/posix/prefix.mingw builds/posix/prefix.mingw
401 --- builds/posix/prefix.mingw 2016-07-07 13:56:13.048235166 +0200
402 +++ builds/posix/prefix.mingw 2016-07-07 14:50:54.704323046 +0200
403 @@ -20,8 +20,8 @@
406 # -Wno-unused-variable is used due to unused gpre generated variables
407 -PROD_FLAGS=-O2 -DMINGW -Wall -Wshadow -Wundef -Wno-long-long -Wno-unused-variable -Wno-sign-compare -Wno-parentheses -Wno-switch -fmessage-length=0 -Dlint -DWIN32_LEAN_AND_MEAN -MMD -mthreads -Wno-non-virtual-dtor
408 -DEV_FLAGS=-ggdb -DMINGW -Wall -Wshadow -Wundef -Wno-long-long -Wno-unused-variable -Wno-sign-compare -Wno-parentheses -Wno-switch -fmessage-length=0 -Dlint -DWIN32_LEAN_AND_MEAN -MMD -mthreads -Wno-non-virtual-dtor
409 +PROD_FLAGS=-O2 -DMINGW -Dlint -DWIN32_LEAN_AND_MEAN
410 +DEV_FLAGS=-ggdb -DMINGW -Dlint -DWIN32_LEAN_AND_MEAN
412 PLATFORM_PATH=os/win32
414 @@ -29,6 +29,7 @@
415 LIB_LINK=$(LD)
417 LIB_LINK_OPTIONS+=-Wl,--enable-stdcall-fixup
418 +LIB_PLATFORM_RPATH=
420 # Strip symbols from release versions to decrease size
421 ifeq ($(IsProdTypeBuild),Y)
422 @@ -36,6 +37,9 @@
423 LIB_LINK_OPTIONS+=-Wl,-s
424 endif
426 +LIB_LINK_OPTIONS=
427 +LINK_OPTS=
429 # Generation of fbclient_ms.lib
430 LIB_LINK_IMPLIB:=-Wl,--out-implib,firebird/lib/fbclient_ms.lib
431 LIB_GUI:= -mwindows -lcomctl32 -lgdi32
432 @@ -55,7 +59,8 @@
433 ClientLibrarySoName := $(ClientLibraryName)
435 # Looks like MinGW 3 does not support version scripts but support def-files
436 -LINK_FIREBIRD_SYMBOLS = $(BLD_ROOT)/win32/defs/fbclient_s.def $(BLD_ROOT)/win32/defs/fbclient.def
437 +LINK_FIREBIRD_SYMBOLS = /def:$(BLD_ROOT)/win32/defs/fbclient_s.def /def:$(BLD_ROOT)/win32/defs/firebird.def
438 +LINK_PLUGIN_SYMBOLS = /def:$(BLD_ROOT)/win32/defs/plugin.def
440 # This is required for newly built executable to find newly built shared
441 # libraries because on Win32 there is no such thing as LD_LIBRARY_PATH
442 --- builds/posix/make.shared.variables 2016-07-22 17:07:46.650672300 +0200
443 +++ builds/posix/make.shared.variables 2016-07-23 10:44:41.311454600 +0200
444 @@ -56,6 +56,7 @@
445 Remote_Server:= $(call dirObjects,remote/server) $(call dirObjects,auth/SecureRemotePassword/server)
446 Remote_Client:= $(call dirObjects,remote/client) $(call dirObjects,auth/SecureRemotePassword/client) \
447 $(call makeObjects,auth/SecurityDatabase,LegacyClient.cpp) \
448 + $(call dirObjects,auth/trusted) \
449 $(call dirObjects,plugins/crypt/arc4)
450 Remote_Server_Objects:= $(Remote_Common) $(Remote_Server)
451 Remote_Client_Objects:= $(Remote_Common) $(Remote_Client)
452 diff -ur configure configure
453 --- configure 2016-07-07 13:55:54.976234682 +0200
454 +++ configure 2016-07-07 14:54:30.012328812 +0200
455 @@ -3337,6 +3337,14 @@
456 SHRLIB_EXT=dll
459 + *-*-cygwin*)
460 + MAKEFILE_PREFIX=mingw
461 + PLATFORM=win32
462 + EDITLINE_FLG=N
463 + RAW_DEVICES_FLG=N
464 + SHRLIB_EXT=dll
465 + ;;
468 as_fn_error $? "unsupported platform ${build}" "$LINENO" 5
470 @@ -8432,6 +8432,9 @@
471 mingw*)
472 opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
474 +cygwin*)
475 + opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
476 + ;;
477 esac
479 # Try without a prefix underscore, then with it.
480 diff -ur extern/btyacc/main.c extern/btyacc/main.c
481 --- extern/btyacc/main.c 2016-07-07 13:55:55.448234695 +0200
482 +++ extern/btyacc/main.c 2016-07-07 14:56:03.560331317 +0200
483 @@ -2,7 +2,7 @@
484 #include <signal.h>
485 #include <stdio.h>
487 -#if defined(WIN32)
488 +#if defined(WIN32) || defined(_WIN32)
489 #include <io.h>
490 #else
491 #include <unistd.h>
492 diff -ur extern/btyacc/Makefile extern/btyacc/Makefile
493 --- extern/btyacc/Makefile 2016-07-07 13:55:55.448234695 +0200
494 +++ extern/btyacc/Makefile 2016-07-07 14:57:42.284333961 +0200
495 @@ -42,7 +42,10 @@
496 all: $(PROGRAM)
498 $(PROGRAM): $(OBJS) $(LIBS)
499 - $(CC) $(LDFLAGS) -o $(PROGRAM) $(OBJS) $(LIBS)
500 + $(CC) -o $(PROGRAM).exe $(OBJS) $(LIBS) $(LDFLAGS)
502 +%.o: %.c
503 + $(CC) -c $< -Fo$@ $(CCFLAGS)
505 clean:; rm -f $(OBJS)
507 --- extern/cloop/src/tests/test1/CppTest.cpp 2016-07-07 15:56:27.948015300 +0200
508 +++ extern/cloop/src/tests/test1/CppTest.cpp 2016-07-13 18:58:48.529822600 +0200
509 @@ -24,6 +24,7 @@
510 #include <stdio.h>
511 #include <assert.h>
513 +#define WIN32
514 #ifdef WIN32
515 #include <windows.h>
516 #define DLL_EXPORT __declspec(dllexport)
517 --- extern/cloop/src/tests/test1/CTest.c 2016-07-07 15:56:27.611791300 +0200
518 +++ extern/cloop/src/tests/test1/CTest.c 2016-07-13 17:04:22.805090300 +0200
519 @@ -23,6 +23,7 @@
520 #include <malloc.h>
521 #include <stdio.h>
523 +#define WIN32
524 #ifdef WIN32
525 #include <windows.h>
526 #define DLL_EXPORT __declspec(dllexport)
527 --- extern/cloop/Makefile 2016-07-07 15:56:28.279136300 +0200
528 +++ extern/cloop/Makefile 2016-07-13 16:22:38.493479800 +0200
529 @@ -11,8 +11,8 @@
530 SRC_DIR := src
531 BUILD_DIR := build
532 OUT_DIR := output
533 -SHRLIB_EXT := .so
534 -EXE_EXT :=
535 +SHRLIB_EXT := .dll
536 +EXE_EXT := .exe
538 OBJ_DIR := $(BUILD_DIR)/$(TARGET)
539 BIN_DIR := $(OUT_DIR)/$(TARGET)/bin
540 @@ -27,7 +27,7 @@
541 OBJS_C := $(patsubst $(SRC_DIR)/%.c,$(OBJ_DIR)/%.o,$(SRCS_C))
542 OBJS_CPP := $(patsubst $(SRC_DIR)/%.cpp,$(OBJ_DIR)/%.o,$(SRCS_CPP))
544 -C_FLAGS := -ggdb -fPIC -MMD -MP -W -Wall -Wno-unused-parameter
545 +C_FLAGS := -fPIC
546 CXX_FLAGS := $(C_FLAGS)
547 FPC_FLAGS := -Mdelphi
549 @@ -53,7 +53,7 @@
550 .PHONY: all mkdirs clean
552 all: mkdirs \
553 - $(BIN_DIR)/cloop \
554 + $(BIN_DIR)/cloop$(EXE_EXT) \
555 $(BIN_DIR)/test1-c$(SHRLIB_EXT) \
556 $(BIN_DIR)/test1-c$(EXE_EXT) \
557 $(BIN_DIR)/test1-cpp$(SHRLIB_EXT) \
558 @@ -74,7 +74,7 @@
559 -include $(addsuffix .d,$(basename $(OBJS_C)))
560 -include $(addsuffix .d,$(basename $(OBJS_CPP)))
562 -$(BIN_DIR)/cloop: \
563 +$(BIN_DIR)/cloop$(EXE_EXT): \
564 $(OBJ_DIR)/cloop/Expr.o \
565 $(OBJ_DIR)/cloop/Generator.o \
566 $(OBJ_DIR)/cloop/Lexer.o \
567 @@ -83,20 +83,20 @@
569 $(LD) $^ -o $@
571 -$(SRC_DIR)/tests/test1/CalcCApi.h: $(BIN_DIR)/cloop $(SRC_DIR)/tests/test1/Interface.idl
572 - $(BIN_DIR)/cloop $(SRC_DIR)/tests/test1/Interface.idl c-header $@ CALC_C_API_H CALC_I
573 +$(SRC_DIR)/tests/test1/CalcCApi.h: $(BIN_DIR)/cloop$(EXE_EXT) $(SRC_DIR)/tests/test1/Interface.idl
574 + $(BIN_DIR)/cloop$(EXE_EXT) $(SRC_DIR)/tests/test1/Interface.idl c-header $@ CALC_C_API_H CALC_I
576 -$(SRC_DIR)/tests/test1/CalcCApi.c: $(BIN_DIR)/cloop $(SRC_DIR)/tests/test1/Interface.idl $(SRC_DIR)/tests/test1/CalcCApi.h
577 - $(BIN_DIR)/cloop $(SRC_DIR)/tests/test1/Interface.idl c-impl $@ CalcCApi.h CALC_I
578 +$(SRC_DIR)/tests/test1/CalcCApi.c: $(BIN_DIR)/cloop$(EXE_EXT) $(SRC_DIR)/tests/test1/Interface.idl $(SRC_DIR)/tests/test1/CalcCApi.h
579 + $(BIN_DIR)/cloop$(EXE_EXT) $(SRC_DIR)/tests/test1/Interface.idl c-impl $@ CalcCApi.h CALC_I
581 -$(SRC_DIR)/tests/test1/CalcCppApi.h: $(BIN_DIR)/cloop $(SRC_DIR)/tests/test1/Interface.idl
582 - $(BIN_DIR)/cloop $(SRC_DIR)/tests/test1/Interface.idl c++ $@ CALC_CPP_API_H calc I
583 +$(SRC_DIR)/tests/test1/CalcCppApi.h: $(BIN_DIR)/cloop$(EXE_EXT) $(SRC_DIR)/tests/test1/Interface.idl
584 + $(BIN_DIR)/cloop$(EXE_EXT) $(SRC_DIR)/tests/test1/Interface.idl c++ $@ CALC_CPP_API_H calc I
586 -$(SRC_DIR)/tests/test1/CalcPascalApi.pas: $(BIN_DIR)/cloop \
587 +$(SRC_DIR)/tests/test1/CalcPascalApi.pas: $(BIN_DIR)/cloop$(EXE_EXT) \
588 $(SRC_DIR)/tests/test1/Interface.idl \
589 $(SRC_DIR)/tests/test1/CalcPascalApi.interface.pas \
590 $(SRC_DIR)/tests/test1/CalcPascalApi.implementation.pas
591 - $(BIN_DIR)/cloop $(SRC_DIR)/tests/test1/Interface.idl pascal $@ CalcPascalApi \
592 + $(BIN_DIR)/cloop$(EXE_EXT) $(SRC_DIR)/tests/test1/Interface.idl pascal $@ CalcPascalApi \
593 --uses "SysUtils" \
594 --interfaceFile $(SRC_DIR)/tests/test1/CalcPascalApi.interface.pas \
595 --implementationFile $(SRC_DIR)/tests/test1/CalcPascalApi.implementation.pas \
596 @@ -108,23 +108,23 @@
597 $(OBJ_DIR)/tests/test1/CalcCApi.o \
598 $(OBJ_DIR)/tests/test1/CTest.o \
600 - $(LD) $^ -shared -ldl -o $@
601 + $(LD) $^ -o $@
603 $(BIN_DIR)/test1-c$(EXE_EXT): \
604 $(OBJ_DIR)/tests/test1/CalcCApi.o \
605 $(OBJ_DIR)/tests/test1/CTest.o \
607 - $(LD) $^ -ldl -o $@
608 + $(LD) $^ -o $@
610 $(BIN_DIR)/test1-cpp$(SHRLIB_EXT): \
611 $(OBJ_DIR)/tests/test1/CppTest.o \
613 - $(LD) $^ -shared -ldl -o $@
614 + $(LD) $^ -o $@
616 $(BIN_DIR)/test1-cpp$(EXE_EXT): \
617 $(OBJ_DIR)/tests/test1/CppTest.o \
619 - $(LD) $^ -ldl -o $@
620 + $(LD) $^ -o $@
622 $(BIN_DIR)/test1-pascal$(SHRLIB_EXT): \
623 $(SRC_DIR)/tests/test1/PascalClasses.pas \
624 diff -ur src/common/classes/fb_string.cpp src/common/classes/fb_string.cpp
625 --- src/common/classes/fb_string.cpp 2016-07-07 13:55:56.064234711 +0200
626 +++ src/common/classes/fb_string.cpp 2016-07-07 14:59:01.516336083 +0200
627 @@ -32,6 +32,12 @@
628 #include <ctype.h>
629 #include <stdarg.h>
631 +#ifdef WIN_NT
632 +#pragma comment(lib, "User32.lib")
633 +#pragma comment(lib, "advapi32")
634 +#pragma comment(lib, "shell32.lib")
635 +#endif
637 #ifdef HAVE_STRCASECMP
638 #define STRNCASECMP strncasecmp
639 #else
640 diff -ur src/misc/makeHeader.cpp src/misc/makeHeader.cpp
641 --- src/misc/makeHeader.cpp 2016-07-07 13:56:00.100234819 +0200
642 +++ src/misc/makeHeader.cpp 2016-07-07 15:00:14.780338045 +0200
643 @@ -1,9 +1,9 @@
644 #include <stdio.h>
645 #include <string.h>
646 #include <errno.h>
647 -//#ifdef HAVE_UNISTD_H
648 +#ifdef HAVE_UNISTD_H
649 #include <unistd.h>
650 -//#endif
651 +#endif