From 86bf476f33e8565aa8dff2bb59b3a33c1c14321f Mon Sep 17 00:00:00 2001
From: Alexpux <alexey.pawlow@gmail.com>
Date: Wed, 26 Nov 2014 09:27:40 +0300
Subject: [PATCH 18/27] For mingw place dll's into BIN and generate import
 libraries in LIB. Don't link with def files.

---
 builds/posix/make.defaults       |  18 +-
 builds/posix/prefix.mingw        |  38 ++-
 builds/win32/defs/fbclient32.def | 703 +++++++++++++++++++++++++++++++++++++++
 builds/win32/defs/fbclient64.def | 361 ++++++++++++++++++++
 4 files changed, 1100 insertions(+), 20 deletions(-)
 create mode 100644 builds/win32/defs/fbclient32.def
 create mode 100644 builds/win32/defs/fbclient64.def

diff --git a/builds/posix/make.defaults b/builds/posix/make.defaults
index 44b4e04586..c2c2ffe343 100755
--- a/builds/posix/make.defaults
+++ b/builds/posix/make.defaults
@@ -93,6 +93,11 @@ IsProdTypeBuild = @PROD_BUILD_FLG@
 
 CpuType=@CPU_TYPE@
 
+ifeq ($(CpuType), x86_64)
+  BITNESS_SUFFIX := 64
+else
+  BITNESS_SUFFIX := 32
+endif
 PLATFORM=@PLATFORM@
 ifeq (@FIREBIRD_ARCH_TYPE@,classic)
 	ArchPrefix=CS
@@ -193,9 +198,9 @@ BLRTABLE	= $(BIN)/blrtable$(EXEC_EXT)
 #     Scold me, but I don't want library names to be in configure.in
 # 
 
-SharedLibraryName=libfbembed.${SHRLIB_EXT}.${FirebirdVersion}
-SharedLibrarySoName=libfbembed.${SHRLIB_EXT}.${MajorVer}.${MinorVer}
-SharedLibraryBaseName=libfbembed.${SHRLIB_EXT}
+SharedLibraryBaseName=$(LIB_PREFIX)fbembed.${SHRLIB_EXT}
+SharedLibraryName=${SharedLibraryBaseName}.${FirebirdVersion}
+SharedLibrarySoName=${SharedLibraryBaseName}.${MajorVer}.${MinorVer}
 
 LIBFBEMBED_SO = $(LIB)/$(SharedLibraryName)
 LIBFBEMBED_SOBASENAME = $(LIB)/$(SharedLibrarySoName)
@@ -261,6 +266,7 @@ LIB_LINK_RPATH = $(call LIB_PLATFORM_RPATH,'$$$$ORIGIN/../$(1)')
 endif
 LIB_PATH_OPTS = $(call LIB_LINK_RPATH,lib) $(call LIB_LINK_RPATH,intl)
 LIB_LINK_SONAME= -Wl,-soname,$(1)
+LIB_LINK_IMPLIB=
 LIB_LINK_MAPFILE= -Wl,--version-script,
 FBEMBED_LINK= -L$(LIB) -lfbembed
 
@@ -281,7 +287,7 @@ LINK_UDF = $(LIB_LINK) $(LIB_LINK_OPTIONS) $(call LIB_LINK_SONAME,$(1).$(SHRLIB_
 LINK_UDF_LIBS = $(THR_LIBS) -L$(LIB) -lib_util
 
 LINK_IB_UTIL = $(LIB_LINK) $(LINK_IBUTIL_SYMBOLS) $(LIB_LINK_OPTIONS)\
- $(call LIB_LINK_SONAME,$(IbUtilLibraryName)) $(call LIB_LINK_RPATH,lib)
+ $(call LIB_LINK_IMPLIB,$(LIB)/lib$(IbUtilLibraryName).a) $(call LIB_LINK_SONAME,$(IbUtilLibraryName)) $(call LIB_LINK_RPATH,lib)
 LINK_IB_UTIL_LIBS = $(THR_LIBS)
 
 LINK_INTL = $(LIB_LINK) $(LINK_FBINTL_SYMBOLS) $(LIB_LINK_OPTIONS)\
@@ -293,11 +299,11 @@ LINK_TRACE = $(LIB_LINK) $(LINK_TRACE_SYMBOLS) $(LIB_LINK_OPTIONS)\
 LINK_TRACE_LIBS = -L$(LIB) $(SO_LINK_LIBS)
 
 LINK_CLIENT = $(CLIENTLIB_LINK) $(LINK_FIREBIRD_CLIENT_SYMBOLS) $(LIB_LINK_OPTIONS)\
- $(LIB_LINK_IMPLIB) $(call LIB_LINK_SONAME,$(ClientLibrarySoName)) $(call LIB_LINK_RPATH,lib)
+ $(call LIB_LINK_IMPLIB,$(LIB)/lib$(ClientLibraryName).a) $(call LIB_LINK_SONAME,$(ClientLibrarySoName)) $(call LIB_LINK_RPATH,lib)
 LINK_CLIENT_LIBS = $(SO_LINK_LIBS) $(STATIC_CXXSUPPORT_LIB)
 
 LINK_EMBED = $(LIB_LINK) $(LINK_FIREBIRD_EMBED_SYMBOLS) $(LIB_LINK_OPTIONS) $(LIB_EMBED_LINK_OPTIONS)\
- $(call LIB_LINK_SONAME,$(SharedLibrarySoName)) $(call LIB_LINK_RPATH,lib)
+ $(call LIB_LINK_IMPLIB,$(LIB)/lib$(SharedLibraryBaseName).a) $(call LIB_LINK_SONAME,$(SharedLibrarySoName)) $(call LIB_LINK_RPATH,lib)
 LINK_EMBED_LIBS = -L$(LIB) $(LIB_GUI) $(SO_LINK_LIBS) $(ICU_LIBS)
 
 # From utilities 
diff --git a/builds/posix/prefix.mingw b/builds/posix/prefix.mingw
index ac1327c46c..8e514d8c33 100644
--- a/builds/posix/prefix.mingw
+++ b/builds/posix/prefix.mingw
@@ -36,16 +36,12 @@ OS_ServerFiles= os/win32/srvr_w32.cpp os/win32/window.cpp os/win32/chop.cpp os/w
 # Override link command for implicit stdc++ linking
 LIB_LINK=$(LD)
 
-LIB_LINK_OPTIONS+=-Wl,--enable-stdcall-fixup
-
 # Strip symbols from release versions to decrease size
 ifeq ($(IsProdTypeBuild),Y)
 LINK_OPTS+=-Wl,-s
 LIB_LINK_OPTIONS+=-Wl,-s
 endif
 
-# Generation of fbclient_ms.lib
-LIB_LINK_IMPLIB:=-Wl,--out-implib,firebird/lib/fbclient_ms.lib
 LIB_GUI:= -mwindows -lcomctl32 -lgdi32
 
 
@@ -65,19 +61,33 @@ FilesToAddDialog2=$(IBGUARD)
 LIB_PREFIX=
 
 # Override library names to suppress version suffix
-ClientLibraryNameFull := $(ClientLibraryName)
-ClientLibrarySoName := $(ClientLibraryName)
+SharedLibraryName = $(SharedLibraryBaseName)
+SharedLibrarySoName = $(SharedLibraryBaseName)
+
+LIBFBEMBED_SO = $(BIN)/$(SharedLibraryName)
+LIBFBEMBED_SOBASENAME = $(BIN)/$(SharedLibrarySoName)
+LIBFBEMBED_SONAME = $(BIN)/$(SharedLibraryBaseName)
+
+ClientLibraryNameFull = $(ClientLibraryName)
+ClientLibrarySoName = $(ClientLibraryName)
+
+LIBFBCLIENT_SO = $(BIN)/$(ClientLibraryNameFull)
+LIBFBCLIENT_SOBASENAME = $(BIN)/$(ClientLibrarySoName)
+LIBFBCLIENT_SONAME = $(BIN)/$(ClientLibraryName)
 
-# Looks like MinGW 3 does not support version scripts but support def-files
-LINK_FIREBIRD_SYMBOLS = $(BLD_ROOT)/win32/defs/fbclient_s.def $(BLD_ROOT)/win32/defs/fbclient.def
+LIBIBUTIL_SO = $(BIN)/$(IbUtilLibraryName)
 
-# This is required for newly built executable to find newly built shared
-# libraries because on Win32 there is no such thing as LD_LIBRARY_PATH
-LIB=$(BIN)
+# Generation of import libraries
+LIB_LINK_IMPLIB= -Wl,--out-implib,$(1)
+LIB_LINK_SONAME=
 
-# Special options for UDF link
-LINK_UDF = $(LIB_LINK) $(LIB_LINK_OPTIONS) $(call LIB_LINK_SONAME,$(1).$(SHRLIB_EXT)) -L$(LIB) -lib_util
-LINK_UDF_LIBS = 
+LINK_FIREBIRD_SYMBOLS = $(BLD_ROOT)/win32/defs/fbclient$(BITNESS_SUFFIX).def
+#LINK_FIREBIRD_EMBED_SYMBOLS =
+#LINK_FIREBIRD_CLIENT_SYMBOLS =
+LINK_TRACE_SYMBOLS =
+LINK_FBINTL_SYMBOLS =
+LINK_IBUTIL_SYMBOLS =
+LINK_EMPTY_SYMBOLS =
 
 # Special options for trace plugin link
 LINK_TRACE_LIBS = -L$(LIB) $(SO_LINK_LIBS) $(ICU_LIBS)
diff --git a/builds/win32/defs/fbclient32.def b/builds/win32/defs/fbclient32.def
new file mode 100644
index 0000000000..e867e6585c
--- /dev/null
+++ b/builds/win32/defs/fbclient32.def
@@ -0,0 +1,703 @@
+; The contents of this file are subject to the Interbase Public
+; License Version 1.0 (the "License"); you may not use this file
+; except in compliance with the License. You may obtain a copy
+; of the License at http://www.Inprise.com/IPL.html
+;
+; Software distributed under the License is distributed on an
+; "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
+; or implied. See the License for the specific language governing
+; rights and limitations under the License.
+;
+; The Original Code was created by Inprise Corporation
+; and its predecessors. Portions created by Inprise Corporation are
+; Copyright (C) Inprise Corporation.
+;
+; All Rights Reserved.
+; Contributor(s): ______________________________________.
+
+LIBRARY "fbclient.dll"
+EXPORTS
+
+;-------------------
+; PRIVATE INTERFACE
+;-------------------
+
+	gds__alloc@4
+	gds__attach_database@24
+	gds__blob_info@24
+	gds__blob_size@16
+	gds__cancel_blob@8
+	gds__cancel_events@12
+	gds__close@8
+	gds__close_blob@8
+	gds__commit_retaining@8
+	gds__commit_transaction@8
+	gds__compile_request@20
+	gds__compile_request2@20
+	gds__create_blob@20
+	gds__create_blob2@28
+	gds__create_database@28
+	gds__database_cleanup@16
+	gds__database_info@24
+	gds__ddl@20
+	gds__declare@12
+	gds__decode@12
+	gds__decode_date@8
+	gds__describe@12
+	gds__describe_bind@12
+	gds__detach_database@8
+	gds__disable_subsystem@4
+	gds__dsql_finish@4
+	gds__edit@8
+	gds__enable_subsystem@4
+	gds__encode@8
+	gds__encode_date@8
+	gds__event_block@0
+	gds__event_counts@16
+	gds__event_wait@20
+	gds__execute@16
+	gds__execute_immediate@20
+	gds__fetch@12
+	gds__free@4
+	gds__ftof@16
+	gds__get_prefix@8
+	gds__get_segment@20
+	gds__get_slice@44
+	gds__interprete@8
+	gds__log@0
+	gds__log_status@8
+	gds__map_blobs@8
+	gds__msg_close@4
+	gds__msg_format@40
+	gds__msg_lookup@24
+	gds__msg_open@8
+	gds__msg_put@32
+	gds__open@16
+	gds__open_blob@20
+	gds__open_blob2@28
+	gds__parse_bpb@16
+	gds__prefix@8
+	gds__prefix_lock@8
+	gds__prefix_msg@8
+	gds__prepare@28
+	gds__prepare_transaction@8
+	gds__prepare_transaction2@16
+	gds__print_blr@16
+	gds__print_status@4
+	gds__put_error@4
+	gds__put_segment@16
+	gds__put_slice@40
+	gds__qtoq@8
+	gds__que_events@28
+	gds__receive@24
+	gds__reconnect_transaction@20
+	gds__register_cleanup@8
+	gds__release_request@8
+	gds__request_info@28
+	gds__rollback_transaction@8
+	gds__seek_blob@20
+	gds__send@24
+	gds__set_debug@4
+	gds__sqlcode@4
+	gds__start_and_send@28
+	gds__start_multiple@16
+	gds__start_request@16
+	gds__start_transaction@0
+	gds__temp_file@20
+	gds__thread_enable@4
+	gds__thread_enter@0
+	gds__thread_exit@0
+	gds__thread_start@20
+	gds__to_sqlda@20
+	gds__transaction_cleanup@16
+	gds__transaction_info@24
+	gds__unregister_cleanup@8
+	gds__unwind_request@12
+	gds__validate_lib_path@16
+	gds__vax_integer@8
+	gds__version@12
+	gds__vtof@12
+	gds__vtov@12
+	gds__default_printer@0
+
+	gds__alloc_debug@12
+
+	gds_alloc_flag_unfreed@4
+	gds_alloc_report@12
+
+	fb_shutdown@8
+	fb_shutdown_callback@16
+	fb_cancel_operation@12
+	fb_disconnect_transaction@8
+
+	perf_format@20
+	perf_get_info@8
+	perf_report@16
+
+	perf64_format@20
+	perf64_get_info@8
+	perf64_report@16
+
+;----------------------------
+; PUBLIC INTERFACE, i.e. API
+;----------------------------
+
+	; Array functions
+
+	isc_array_gen_sdl@20
+	isc_array_get_slice@28
+	isc_array_lookup_bounds@24
+	isc_array_lookup_desc@24
+	isc_array_put_slice@28
+	isc_array_set_desc@28
+	isc_get_slice@44
+	isc_put_slice@40
+
+	; BLOB functions
+
+	isc_blob_default_desc@12
+	isc_blob_gen_bpb@24
+	isc_blob_info@24
+	isc_blob_lookup_desc@28
+	isc_blob_set_desc@28
+	isc_cancel_blob@8
+	isc_close_blob@8
+	isc_create_blob@20
+	isc_create_blob2@28
+	isc_get_segment@20
+	isc_open_blob@20
+	isc_open_blob2@28
+	isc_put_segment@16
+	
+	; Database functions
+
+	isc_attach_database@24
+	isc_create_database@28
+	isc_database_info@24
+	isc_detach_database@8
+	isc_drop_database@8
+	isc_expand_dpb@0
+	isc_modify_dpb@20
+	isc_version@12
+	isc_get_client_major_version@0
+	isc_get_client_minor_version@0
+	isc_get_client_version@4
+
+	; Conversion functions
+
+	isc_decode_date@8
+	isc_decode_sql_date@8
+	isc_decode_sql_time@8
+	isc_decode_timestamp@8
+	isc_encode_date@8
+	isc_encode_sql_date@8
+	isc_encode_sql_time@8
+	isc_encode_timestamp@8
+	isc_portable_integer@8
+	isc_vax_integer@8
+
+	; DSQL functions
+
+	isc_dsql_allocate_statement@12
+	isc_dsql_alloc_statement2@12
+	isc_dsql_describe@16
+	isc_dsql_describe_bind@16
+	isc_dsql_execute@20
+	isc_dsql_execute2@24
+	isc_dsql_execute_m@32
+	isc_dsql_execute2_m@52
+	isc_dsql_execute_immediate@28
+	isc_dsql_exec_immed2@32
+	isc_dsql_execute_immediate_m@44
+	isc_dsql_exec_immed2_m@64
+	isc_dsql_exec_immed3_m@64
+	isc_dsql_fetch@16
+	isc_dsql_fetch_a@20
+	isc_dsql_fetch_m@28
+	isc_dsql_finish@4
+	isc_dsql_free_statement@12
+	isc_dsql_insert@16
+	isc_dsql_insert_m@28
+	isc_dsql_prepare@28
+	isc_dsql_prepare_m@40
+	isc_dsql_release@8
+	isc_dsql_set_cursor_name@16
+	isc_dsql_sql_info@24
+
+	; ESQL functions
+
+	isc_embed_dsql_close@8
+	isc_embed_dsql_declare@12
+	isc_embed_dsql_describe@16
+	isc_embed_dsql_describe_bind@16
+	isc_embed_dsql_execute@20
+	isc_embed_dsql_execute2@24
+	isc_embed_dsql_execute_immed@28
+	isc_embed_dsql_exec_immed2@32
+	isc_embed_dsql_fetch@16
+	isc_embed_dsql_fetch_a@20
+	isc_embed_dsql_insert@16
+	isc_embed_dsql_open@20
+	isc_embed_dsql_open2@24
+	isc_embed_dsql_prepare@32
+	isc_embed_dsql_release@8
+	isc_embed_dsql_length@8
+
+	; Error-handling functions
+
+	isc_interprete@8
+	fb_interpret@12
+	isc_print_sqlerror@8
+	isc_print_status@4
+	isc_sqlcode@4
+	isc_sql_interprete@12
+	isc_sqlcode_s@8
+	fb_sqlstate@8
+
+	; Event functions
+
+	isc_cancel_events@12
+	isc_event_block@0
+	isc_event_counts@16
+	isc_que_events@28
+	isc_wait_for_event@20
+	isc_event_block_a@16
+	isc_event_block_s@20
+
+	; Security functions
+
+	isc_add_user@8
+	isc_delete_user@8
+	isc_modify_user@8
+
+	; Services functions
+
+	isc_service_attach@24
+	isc_service_detach@8
+	isc_service_query@36
+	isc_service_start@20
+
+	; Transaction control functions
+
+	isc_commit_retaining@8
+	isc_commit_transaction@8
+	isc_prepare_transaction@8
+	isc_prepare_transaction2@16
+	isc_rollback_retaining@8
+	isc_rollback_transaction@8
+	isc_start_multiple@16
+	isc_start_transaction@0
+	isc_transaction_info@24
+
+	; Other functions
+
+	isc_compile_request@20
+	isc_compile_request2@20
+	isc_ddl@20
+	isc_prepare@28
+	isc_receive@24
+	isc_reconnect_transaction@20
+	isc_release_request@8
+	isc_request_info@28
+	isc_seek_blob@20
+	isc_send@24
+	isc_start_and_send@28
+	isc_start_request@16
+	isc_transact_request@36
+	isc_unwind_request@12
+
+	; Other SQL functions
+
+	isc_close@8
+	isc_declare@12
+	isc_describe@12
+	isc_describe_bind@12
+	isc_execute@16
+	isc_execute_immediate@20
+	isc_fetch@12
+	isc_fetch_a@16
+	isc_open@16
+
+	; Other BLOB functions
+
+	BLOB_close@4
+	BLOB_display@16
+	BLOB_dump@16
+	BLOB_edit@16
+	BLOB_get@4
+	BLOB_load@16
+	BLOB_open@12
+	BLOB_put@8
+	BLOB_text_dump@16
+	BLOB_text_load@16
+	Bopen@16
+
+	; Other misc functions
+
+	isc_ftof@16
+	isc_free@4
+	isc_print_blr@16
+	fb_print_blr@20
+	isc_qtoq@8
+	isc_reset_fpe@4
+	isc_set_debug@4
+	isc_to_sqlda@20
+	isc_vtof@12
+	isc_vtov@12
+	isc_baddress@4
+	isc_baddress_s@8
+
+	_isc_start_transaction = isc_start_transaction@0
+	_isc_expand_dpb = isc_expand_dpb@0
+	_isc_event_block = isc_event_block@0
+
+;-----------------
+; OTHER FUNCTIONS
+;-----------------
+
+	CVT_move@12
+
+	KEYWORD_stringIsAToken@4
+	KEYWORD_getTokens@0
+
+;--------------------------------------
+; DUPLICATE FOR COMPATIBILITY WITH MSVC
+;--------------------------------------
+
+;-------------------
+; PRIVATE INTERFACE
+;-------------------
+
+	gds__alloc = gds__alloc@4	@1
+	gds__attach_database = gds__attach_database@24	@2
+	gds__blob_info = gds__blob_info@24	@3
+	gds__blob_size = gds__blob_size@16	@4
+	gds__cancel_blob = gds__cancel_blob@8	@5
+	gds__cancel_events = gds__cancel_events@12	@6
+	gds__close = gds__close@8	@7
+	gds__close_blob = gds__close_blob@8	@8
+	gds__commit_retaining = gds__commit_retaining@8	@9
+	gds__commit_transaction = gds__commit_transaction@8	@10
+	gds__compile_request = gds__compile_request@20	@11
+	gds__compile_request2 = gds__compile_request2@20	@12
+	gds__create_blob = gds__create_blob@20	@13
+	gds__create_blob2 = gds__create_blob2@28	@14
+	gds__create_database = gds__create_database@28	@15
+	gds__database_cleanup = gds__database_cleanup@16	@16
+	gds__database_info = gds__database_info@24	@17
+	gds__ddl = gds__ddl@20	@18
+	gds__declare = gds__declare@12	@19
+	gds__decode = gds__decode@12	@20
+	gds__decode_date = gds__decode_date@8	@21
+	gds__describe = gds__describe@12	@22
+	gds__describe_bind = gds__describe_bind@12	@23
+	gds__detach_database = gds__detach_database@8	@24
+	gds__disable_subsystem = gds__disable_subsystem@4	@25
+	gds__dsql_finish = gds__dsql_finish@4	@26
+	gds__edit = gds__edit@8	@27
+	gds__enable_subsystem = gds__enable_subsystem@4	@28
+	gds__encode = gds__encode@8	@29
+	gds__encode_date = gds__encode_date@8	@30
+	gds__event_block = gds__event_block@0	@31
+	gds__event_counts = gds__event_counts@16	@32
+	gds__event_wait = gds__event_wait@20	@33
+	gds__execute = gds__execute@16	@34
+	gds__execute_immediate = gds__execute_immediate@20	@35
+	gds__fetch = gds__fetch@12	@36
+	gds__free = gds__free@4	@37
+	gds__ftof = gds__ftof@16	@38
+	gds__get_prefix = gds__get_prefix@8	@248
+	gds__get_segment = gds__get_segment@20	@39
+	gds__get_slice = gds__get_slice@44	@40
+	gds__interprete = gds__interprete@8	@41
+	gds__log = gds__log@0	@42
+	gds__log_status = gds__log_status@8	@142
+	gds__map_blobs = gds__map_blobs@8	@240
+	gds__msg_close = gds__msg_close@4	@223
+	gds__msg_format = gds__msg_format@40	@43
+	gds__msg_lookup = gds__msg_lookup@24	@44
+	gds__msg_open = gds__msg_open@8	@45
+	gds__msg_put = gds__msg_put@32	@46
+	gds__open = gds__open@16	@47
+	gds__open_blob = gds__open_blob@20	@48
+	gds__open_blob2 = gds__open_blob2@28	@49
+	gds__parse_bpb = gds__parse_bpb@16	@50
+	gds__prefix = gds__prefix@8	@51
+	gds__prefix_lock = gds__prefix_lock@8	@249
+	gds__prefix_msg = gds__prefix_msg@8	@250
+	gds__prepare = gds__prepare@28	@52
+	gds__prepare_transaction = gds__prepare_transaction@8	@53
+	gds__prepare_transaction2 = gds__prepare_transaction2@16	@54
+	gds__print_blr = gds__print_blr@16	@55
+	gds__print_status = gds__print_status@4	@56
+	gds__put_error = gds__put_error@4	@57
+	gds__put_segment = gds__put_segment@16	@58
+	gds__put_slice = gds__put_slice@40	@59
+	gds__qtoq = gds__qtoq@8	@60
+	gds__que_events = gds__que_events@28	@61
+	gds__receive = gds__receive@24	@62
+	gds__reconnect_transaction = gds__reconnect_transaction@20	@63
+	gds__register_cleanup = gds__register_cleanup@8	@64
+	gds__release_request = gds__release_request@8	@65
+	gds__request_info = gds__request_info@28	@66
+	gds__rollback_transaction = gds__rollback_transaction@8	@67
+	gds__seek_blob = gds__seek_blob@20	@68
+	gds__send = gds__send@24	@69
+	gds__set_debug = gds__set_debug@4	@70
+	gds__sqlcode = gds__sqlcode@4	@71
+	gds__start_and_send = gds__start_and_send@28	@72
+	gds__start_multiple = gds__start_multiple@16	@73
+	gds__start_request = gds__start_request@16	@74
+	gds__start_transaction = gds__start_transaction@0	@75
+	gds__temp_file = gds__temp_file@20	@231
+	gds__thread_enable = gds__thread_enable@4	@76
+	gds__thread_enter = gds__thread_enter@0	@77
+	gds__thread_exit = gds__thread_exit@0	@78
+	gds__thread_start = gds__thread_start@20	@79
+	gds__to_sqlda = gds__to_sqlda@20	@80
+	gds__transaction_cleanup = gds__transaction_cleanup@16	@235
+	gds__transaction_info = gds__transaction_info@24	@81
+	gds__unregister_cleanup = gds__unregister_cleanup@8	@224
+	gds__unwind_request = gds__unwind_request@12	@82
+	gds__validate_lib_path = gds__validate_lib_path@16	@255
+	gds__vax_integer = gds__vax_integer@8	@83
+	gds__version = gds__version@12	@84
+	gds__vtof = gds__vtof@12	@85
+	gds__vtov = gds__vtov@12	@86
+	gds__default_printer = gds__default_printer@0 @87
+
+	gds__alloc_debug = gds__alloc_debug@12
+
+	gds_alloc_flag_unfreed = gds_alloc_flag_unfreed@4
+	gds_alloc_report = gds_alloc_report@12
+
+	fb_shutdown = fb_shutdown@8
+	fb_shutdown_callback = fb_shutdown_callback@16
+	fb_cancel_operation = fb_cancel_operation@12
+	fb_disconnect_transaction = fb_disconnect_transaction@8
+
+	perf_format = perf_format@20	@100
+	perf_get_info = perf_get_info@8	@101
+	perf_report = perf_report@16	@102
+
+	perf64_format = perf64_format@20
+	perf64_get_info = perf64_get_info@8
+	perf64_report = perf64_report@16
+
+;----------------------------
+; PUBLIC INTERFACE, i.e. API
+;----------------------------
+
+	; Array functions
+
+	isc_array_gen_sdl = isc_array_gen_sdl@20	@217
+	isc_array_get_slice = isc_array_get_slice@28	@218
+	isc_array_lookup_bounds = isc_array_lookup_bounds@24	@219
+	isc_array_lookup_desc = isc_array_lookup_desc@24	@220
+	isc_array_put_slice = isc_array_put_slice@28	@221
+	isc_array_set_desc = isc_array_set_desc@28	@222
+	isc_get_slice = isc_get_slice@44	@140
+	isc_put_slice = isc_put_slice@40	@153
+
+	; BLOB functions
+
+	isc_blob_default_desc = isc_blob_default_desc@12	@239
+	isc_blob_gen_bpb = isc_blob_gen_bpb@24	@236
+	isc_blob_info = isc_blob_info@24	@108
+	isc_blob_lookup_desc = isc_blob_lookup_desc@28	@237
+	isc_blob_set_desc = isc_blob_set_desc@28	@238
+	isc_cancel_blob = isc_cancel_blob@8	@110
+	isc_close_blob = isc_close_blob@8	@113
+	isc_create_blob = isc_create_blob@20	@118
+	isc_create_blob2 = isc_create_blob2@28	@119
+	isc_get_segment = isc_get_segment@20	@139
+	isc_open_blob = isc_open_blob@20	@144
+	isc_open_blob2 = isc_open_blob2@28	@145
+	isc_put_segment = isc_put_segment@16	@152
+	
+	; Database functions
+
+	isc_attach_database = isc_attach_database@24	@103
+	isc_create_database = isc_create_database@28	@120
+	isc_database_info = isc_database_info@24	@122
+	isc_detach_database = isc_detach_database@8	@128
+	isc_drop_database = isc_drop_database@8	@229
+	isc_expand_dpb = isc_expand_dpb@0	@135
+	isc_modify_dpb = isc_modify_dpb@20	@244
+	isc_version = isc_version@12	@174
+	isc_get_client_major_version = isc_get_client_major_version@0	@268
+	isc_get_client_minor_version = isc_get_client_minor_version@0	@269
+	isc_get_client_version = isc_get_client_version@4	@270
+
+	; Conversion functions
+
+	isc_decode_date = isc_decode_date@8	@125
+	isc_decode_sql_date = isc_decode_sql_date@8	@261
+	isc_decode_sql_time = isc_decode_sql_time@8	@262
+	isc_decode_timestamp = isc_decode_timestamp@8	@263
+	isc_encode_date = isc_encode_date@8	@129
+	isc_encode_sql_date = isc_encode_sql_date@8	@264
+	isc_encode_sql_time = isc_encode_sql_time@8	@265
+	isc_encode_timestamp = isc_encode_timestamp@8	@266
+	isc_portable_integer = isc_portable_integer@8	@259
+	isc_vax_integer = isc_vax_integer@8	@173
+
+	; DSQL functions
+
+	isc_dsql_allocate_statement = isc_dsql_allocate_statement@12	@178
+	isc_dsql_alloc_statement2 = isc_dsql_alloc_statement2@12	@179
+	isc_dsql_describe = isc_dsql_describe@16	@180
+	isc_dsql_describe_bind = isc_dsql_describe_bind@16	@181
+	isc_dsql_execute = isc_dsql_execute@20	@182
+	isc_dsql_execute2 = isc_dsql_execute2@24	@183
+	isc_dsql_execute_m = isc_dsql_execute_m@32	@184
+	isc_dsql_execute2_m = isc_dsql_execute2_m@52	@185
+	isc_dsql_execute_immediate = isc_dsql_execute_immediate@28	@186
+	isc_dsql_exec_immed2 = isc_dsql_exec_immed2@32	@187
+	isc_dsql_execute_immediate_m = isc_dsql_execute_immediate_m@44	@188
+	isc_dsql_exec_immed2_m = isc_dsql_exec_immed2_m@64	@189
+	isc_dsql_exec_immed3_m = isc_dsql_exec_immed3_m@64	@230
+	isc_dsql_fetch = isc_dsql_fetch@16	@190
+	isc_dsql_fetch_a = isc_dsql_fetch_a@20	@191
+	isc_dsql_fetch_m = isc_dsql_fetch_m@28	@192
+	isc_dsql_finish = isc_dsql_finish@4	@193
+	isc_dsql_free_statement = isc_dsql_free_statement@12	@194
+	isc_dsql_insert = isc_dsql_insert@16	@195
+	isc_dsql_insert_m = isc_dsql_insert_m@28	@196
+	isc_dsql_prepare = isc_dsql_prepare@28	@197
+	isc_dsql_prepare_m = isc_dsql_prepare_m@40	@198
+	isc_dsql_release = isc_dsql_release@8	@199
+	isc_dsql_set_cursor_name = isc_dsql_set_cursor_name@16	@200
+	isc_dsql_sql_info = isc_dsql_sql_info@24	@201
+
+	; ESQL functions
+
+	isc_embed_dsql_close = isc_embed_dsql_close@8	@202
+	isc_embed_dsql_declare = isc_embed_dsql_declare@12	@203
+	isc_embed_dsql_describe = isc_embed_dsql_describe@16	@204
+	isc_embed_dsql_describe_bind = isc_embed_dsql_describe_bind@16	@205
+	isc_embed_dsql_execute = isc_embed_dsql_execute@20	@206
+	isc_embed_dsql_execute2 = isc_embed_dsql_execute2@24	@207
+	isc_embed_dsql_execute_immed = isc_embed_dsql_execute_immed@28	@208
+	isc_embed_dsql_exec_immed2 = isc_embed_dsql_exec_immed2@32	@209
+	isc_embed_dsql_fetch = isc_embed_dsql_fetch@16	@210
+	isc_embed_dsql_fetch_a = isc_embed_dsql_fetch_a@20	@211
+	isc_embed_dsql_insert = isc_embed_dsql_insert@16	@212
+	isc_embed_dsql_open = isc_embed_dsql_open@20	@213
+	isc_embed_dsql_open2 = isc_embed_dsql_open2@24	@214
+	isc_embed_dsql_prepare = isc_embed_dsql_prepare@32	@215
+	isc_embed_dsql_release = isc_embed_dsql_release@8	@216
+	isc_embed_dsql_length = isc_embed_dsql_length@8	@273
+
+	; Error-handling functions
+
+	isc_interprete = isc_interprete@8	@141
+	fb_interpret = fb_interpret@12
+	isc_print_sqlerror = isc_print_sqlerror@8	@150
+	isc_print_status = isc_print_status@4	@151
+	isc_sqlcode = isc_sqlcode@4	@165
+	isc_sql_interprete = isc_sql_interprete@12	@164
+	isc_sqlcode_s = isc_sqlcode_s@8		@278
+	fb_sqlstate = fb_sqlstate@8			@279
+
+	; Event functions
+
+	isc_cancel_events = isc_cancel_events@12	@111
+	isc_event_block = isc_event_block@0	@130
+	isc_event_counts = isc_event_counts@16	@131
+	isc_que_events = isc_que_events@28	@155
+	isc_wait_for_event = isc_wait_for_event@20	@177
+	isc_event_block_a = isc_event_block_a@16	@274
+	isc_event_block_s = isc_event_block_s@20	@275
+
+	; Security functions
+
+	isc_add_user = isc_add_user@8	@256
+	isc_delete_user = isc_delete_user@8	@257
+	isc_modify_user = isc_modify_user@8	@258
+
+	; Services functions
+
+	isc_service_attach = isc_service_attach@24	@225
+	isc_service_detach = isc_service_detach@8	@226
+	isc_service_query = isc_service_query@36	@227
+	isc_service_start = isc_service_start@20	@228
+
+	; Transaction control functions
+
+	isc_commit_retaining = isc_commit_retaining@8	@114
+	isc_commit_transaction = isc_commit_transaction@8	@115
+	isc_prepare_transaction = isc_prepare_transaction@8	@147
+	isc_prepare_transaction2 = isc_prepare_transaction2@16	@148
+	isc_rollback_retaining = isc_rollback_retaining@8	@260
+	isc_rollback_transaction = isc_rollback_transaction@8	@160
+	isc_start_multiple = isc_start_multiple@16	@167
+	isc_start_transaction = isc_start_transaction@0	@169
+	isc_transaction_info = isc_transaction_info@24	@171
+
+	; Other functions
+
+	isc_compile_request = isc_compile_request@20	@116
+	isc_compile_request2 = isc_compile_request2@20	@117
+	isc_ddl = isc_ddl@20	@123
+	isc_prepare = isc_prepare@28	@146
+	isc_receive = isc_receive@24	@156
+	isc_reconnect_transaction = isc_reconnect_transaction@20	@157
+	isc_release_request = isc_release_request@8	@158
+	isc_request_info = isc_request_info@28	@159
+	isc_seek_blob = isc_seek_blob@20	@161
+	isc_send = isc_send@24	@162
+	isc_start_and_send = isc_start_and_send@28	@166
+	isc_start_request = isc_start_request@16	@168
+	isc_transact_request = isc_transact_request@36	@132
+	isc_unwind_request = isc_unwind_request@12	@172
+
+	; Other SQL functions
+
+	isc_close = isc_close@8	@112
+	isc_declare = isc_declare@12	@124
+	isc_describe = isc_describe@12	@126
+	isc_describe_bind = isc_describe_bind@12	@127
+	isc_execute = isc_execute@16	@133
+	isc_execute_immediate = isc_execute_immediate@20	@134
+	isc_fetch = isc_fetch@12	@136
+	isc_fetch_a = isc_fetch_a@16	@137
+	isc_open = isc_open@16	@143
+
+	; Other BLOB functions
+
+	BLOB_close = BLOB_close@4	@91
+	BLOB_display = BLOB_display@16	@92
+	BLOB_dump = BLOB_dump@16	@93
+	BLOB_edit = BLOB_edit@16	@94
+	BLOB_get = BLOB_get@4	@95
+	BLOB_load = BLOB_load@16	@96
+	BLOB_open = BLOB_open@12	@97
+	BLOB_put = BLOB_put@8	@98
+	BLOB_text_dump = BLOB_text_dump@16	@242
+	BLOB_text_load = BLOB_text_load@16	@243
+	Bopen = Bopen@16	@99
+
+	; Other misc functions
+
+	isc_ftof = isc_ftof@16	@138
+	isc_free = isc_free@4	@241
+	isc_print_blr = isc_print_blr@16	@149
+	fb_print_blr = fb_print_blr@20	@280
+	isc_qtoq = isc_qtoq@8	@154
+	isc_reset_fpe = isc_reset_fpe@4
+	isc_set_debug = isc_set_debug@4	@163
+	isc_to_sqlda = isc_to_sqlda@20	@170
+	isc_vtof = isc_vtof@12	@175
+	isc_vtov = isc_vtov@12	@176
+	isc_baddress = isc_baddress@4	@276
+	isc_baddress_s = isc_baddress_s@8	@277
+
+;-----------------
+; OTHER FUNCTIONS
+;-----------------
+
+	CVT_move = CVT_move@12	@267
+
+	KEYWORD_stringIsAToken = KEYWORD_stringIsAToken@4	@271
+	KEYWORD_getTokens = KEYWORD_getTokens@0	@272
diff --git a/builds/win32/defs/fbclient64.def b/builds/win32/defs/fbclient64.def
new file mode 100644
index 0000000000..ce3875c248
--- /dev/null
+++ b/builds/win32/defs/fbclient64.def
@@ -0,0 +1,361 @@
+; The contents of this file are subject to the Interbase Public
+; License Version 1.0 (the "License"); you may not use this file
+; except in compliance with the License. You may obtain a copy
+; of the License at http://www.Inprise.com/IPL.html
+;
+; Software distributed under the License is distributed on an
+; "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express
+; or implied. See the License for the specific language governing
+; rights and limitations under the License.
+;
+; The Original Code was created by Inprise Corporation
+; and its predecessors. Portions created by Inprise Corporation are
+; Copyright (C) Inprise Corporation.
+;
+; All Rights Reserved.
+; Contributor(s): ______________________________________.
+
+LIBRARY "fbclient.dll"
+EXPORTS
+
+;-------------------
+; PRIVATE INTERFACE
+;-------------------
+
+	gds__alloc	@1
+	gds__attach_database	@2
+	gds__blob_info	@3
+	gds__blob_size	@4
+	gds__cancel_blob	@5
+	gds__cancel_events	@6
+	gds__close	@7
+	gds__close_blob	@8
+	gds__commit_retaining	@9
+	gds__commit_transaction	@10
+	gds__compile_request	@11
+	gds__compile_request2	@12
+	gds__create_blob	@13
+	gds__create_blob2	@14
+	gds__create_database	@15
+	gds__database_cleanup	@16
+	gds__database_info	@17
+	gds__ddl	@18
+	gds__declare	@19
+	gds__decode	@20
+	gds__decode_date	@21
+	gds__describe	@22
+	gds__describe_bind	@23
+	gds__detach_database	@24
+	gds__disable_subsystem	@25
+	gds__dsql_finish	@26
+	gds__edit	@27
+	gds__enable_subsystem	@28
+	gds__encode	@29
+	gds__encode_date	@30
+	gds__event_block	@31
+	gds__event_counts	@32
+	gds__event_wait	@33
+	gds__execute	@34
+	gds__execute_immediate	@35
+	gds__fetch	@36
+	gds__free	@37
+	gds__ftof	@38
+	gds__get_prefix	@248
+	gds__get_segment	@39
+	gds__get_slice	@40
+	gds__interprete	@41
+	gds__log	@42
+	gds__log_status	@142
+	gds__map_blobs	@240
+	gds__msg_close	@223
+	gds__msg_format	@43
+	gds__msg_lookup	@44
+	gds__msg_open	@45
+	gds__msg_put	@46
+	gds__open	@47
+	gds__open_blob	@48
+	gds__open_blob2	@49
+	gds__parse_bpb	@50
+	gds__prefix	@51
+	gds__prefix_lock	@249
+	gds__prefix_msg	@250
+	gds__prepare	@52
+	gds__prepare_transaction	@53
+	gds__prepare_transaction2	@54
+	gds__print_blr	@55
+	gds__print_status	@56
+	gds__put_error	@57
+	gds__put_segment	@58
+	gds__put_slice	@59
+	gds__qtoq	@60
+	gds__que_events	@61
+	gds__receive	@62
+	gds__reconnect_transaction	@63
+	gds__register_cleanup	@64
+	gds__release_request	@65
+	gds__request_info	@66
+	gds__rollback_transaction	@67
+	gds__seek_blob	@68
+	gds__send	@69
+	gds__set_debug	@70
+	gds__sqlcode	@71
+	gds__start_and_send	@72
+	gds__start_multiple	@73
+	gds__start_request	@74
+	gds__start_transaction	@75
+	gds__temp_file	@231
+	gds__thread_enable	@76
+	gds__thread_enter	@77
+	gds__thread_exit	@78
+	gds__thread_start	@79
+	gds__to_sqlda	@80
+	gds__transaction_cleanup	@235
+	gds__transaction_info	@81
+	gds__unregister_cleanup	@224
+	gds__unwind_request	@82
+	gds__validate_lib_path	@255
+	gds__vax_integer	@83
+	gds__version	@84
+	gds__vtof	@85
+	gds__vtov	@86
+	gds__default_printer @87
+
+    gds__alloc_debug
+
+    gds_alloc_flag_unfreed
+    gds_alloc_report
+
+	fb_shutdown
+	fb_shutdown_callback
+	fb_cancel_operation
+	fb_disconnect_transaction
+
+	perf_format	@100
+	perf_get_info	@101
+	perf_report	@102
+
+	perf64_format
+	perf64_get_info
+	perf64_report
+
+;----------------------------
+; PUBLIC INTERFACE, i.e. API
+;----------------------------
+
+	; Array functions
+
+	isc_array_gen_sdl	@217
+	isc_array_get_slice	@218
+	isc_array_lookup_bounds	@219
+	isc_array_lookup_desc	@220
+	isc_array_put_slice	@221
+	isc_array_set_desc	@222
+	isc_get_slice	@140
+	isc_put_slice	@153
+
+	; BLOB functions
+
+	isc_blob_default_desc	@239
+	isc_blob_gen_bpb	@236
+	isc_blob_info	@108
+	isc_blob_lookup_desc	@237
+	isc_blob_set_desc	@238
+	isc_cancel_blob	@110
+	isc_close_blob	@113
+	isc_create_blob	@118
+	isc_create_blob2	@119
+	isc_get_segment	@139
+	isc_open_blob	@144
+	isc_open_blob2	@145
+	isc_put_segment	@152
+	
+	; Database functions
+
+	isc_attach_database	@103
+	isc_create_database	@120
+	isc_database_info	@122
+	isc_detach_database	@128
+	isc_drop_database	@229
+	isc_expand_dpb	@135
+	isc_modify_dpb	@244
+	isc_version	@174
+	isc_get_client_major_version	@268
+	isc_get_client_minor_version	@269
+	isc_get_client_version	@270
+
+	; Conversion functions
+
+	isc_decode_date	@125
+	isc_decode_sql_date	@261
+	isc_decode_sql_time	@262
+	isc_decode_timestamp	@263
+	isc_encode_date	@129
+	isc_encode_sql_date	@264
+	isc_encode_sql_time	@265
+	isc_encode_timestamp	@266
+	isc_portable_integer	@259
+	isc_vax_integer	@173
+
+	; DSQL functions
+
+	isc_dsql_allocate_statement	@178
+	isc_dsql_alloc_statement2	@179
+	isc_dsql_describe	@180
+	isc_dsql_describe_bind	@181
+	isc_dsql_execute	@182
+	isc_dsql_execute2	@183
+	isc_dsql_execute_m	@184
+	isc_dsql_execute2_m	@185
+	isc_dsql_execute_immediate	@186
+	isc_dsql_exec_immed2	@187
+	isc_dsql_execute_immediate_m	@188
+	isc_dsql_exec_immed2_m	@189
+	isc_dsql_exec_immed3_m	@230
+	isc_dsql_fetch	@190
+	isc_dsql_fetch_a	@191
+	isc_dsql_fetch_m	@192
+	isc_dsql_finish	@193
+	isc_dsql_free_statement	@194
+	isc_dsql_insert	@195
+	isc_dsql_insert_m	@196
+	isc_dsql_prepare	@197
+	isc_dsql_prepare_m	@198
+	isc_dsql_release	@199
+	isc_dsql_set_cursor_name	@200
+	isc_dsql_sql_info	@201
+
+	; ESQL functions
+
+	isc_embed_dsql_close	@202
+	isc_embed_dsql_declare	@203
+	isc_embed_dsql_describe	@204
+	isc_embed_dsql_describe_bind	@205
+	isc_embed_dsql_execute	@206
+	isc_embed_dsql_execute2	@207
+	isc_embed_dsql_execute_immed	@208
+	isc_embed_dsql_exec_immed2	@209
+	isc_embed_dsql_fetch	@210
+	isc_embed_dsql_fetch_a	@211
+	isc_embed_dsql_insert	@212
+	isc_embed_dsql_open	@213
+	isc_embed_dsql_open2	@214
+	isc_embed_dsql_prepare	@215
+	isc_embed_dsql_release	@216
+	isc_embed_dsql_length	@273
+
+	; Error-handling functions
+
+	isc_interprete	@141
+	fb_interpret
+	isc_print_sqlerror	@150
+	isc_print_status	@151
+	isc_sqlcode	@165
+	isc_sql_interprete	@164
+	isc_sqlcode_s		@278
+	fb_sqlstate			@279
+
+	; Event functions
+
+	isc_cancel_events	@111
+	isc_event_block	@130
+	isc_event_counts	@131
+	isc_que_events	@155
+	isc_wait_for_event	@177
+	isc_event_block_a	@274
+	isc_event_block_s	@275
+
+	; Security functions
+
+	isc_add_user	@256
+	isc_delete_user	@257
+	isc_modify_user	@258
+
+	; Services functions
+
+	isc_service_attach	@225
+	isc_service_detach	@226
+	isc_service_query	@227
+	isc_service_start	@228
+
+	; Transaction control functions
+
+	isc_commit_retaining	@114
+	isc_commit_transaction	@115
+	isc_prepare_transaction	@147
+	isc_prepare_transaction2	@148
+	isc_rollback_retaining	@260
+	isc_rollback_transaction	@160
+	isc_start_multiple	@167
+	isc_start_transaction	@169
+	isc_transaction_info	@171
+
+	; Other functions
+
+	isc_compile_request	@116
+	isc_compile_request2	@117
+	isc_ddl	@123
+	isc_prepare	@146
+	isc_receive	@156
+	isc_reconnect_transaction	@157
+	isc_release_request	@158
+	isc_request_info	@159
+	isc_seek_blob	@161
+	isc_send	@162
+	isc_start_and_send	@166
+	isc_start_request	@168
+	isc_transact_request	@132
+	isc_unwind_request	@172
+
+	; Other SQL functions
+
+	isc_close	@112
+	isc_declare	@124
+	isc_describe	@126
+	isc_describe_bind	@127
+	isc_execute	@133
+	isc_execute_immediate	@134
+	isc_fetch	@136
+	isc_fetch_a	@137
+	isc_open	@143
+
+	; Other BLOB functions
+
+	BLOB_close	@91
+	BLOB_display	@92
+	BLOB_dump	@93
+	BLOB_edit	@94
+	BLOB_get	@95
+	BLOB_load	@96
+	BLOB_open	@97
+	BLOB_put	@98
+	BLOB_text_dump	@242
+	BLOB_text_load	@243
+	Bopen	@99
+
+	; Other misc functions
+
+	isc_ftof	@138
+	isc_free	@241
+	isc_print_blr	@149
+	fb_print_blr	@280
+	isc_qtoq	@154
+	isc_reset_fpe
+	isc_set_debug	@163
+	isc_to_sqlda	@170
+	isc_vtof	@175
+	isc_vtov	@176
+	isc_baddress	@276
+	isc_baddress_s	@277
+
+	_isc_start_transaction=isc_start_transaction
+	_isc_expand_dpb=isc_expand_dpb
+	_isc_event_block=isc_event_block
+
+;-----------------
+; OTHER FUNCTIONS
+;-----------------
+
+	CVT_move	@267
+
+	KEYWORD_stringIsAToken	@271
+	KEYWORD_getTokens	@272
-- 
2.13.0

