[Libreoffice-commits] core.git: external/firebird

Jan-Marek Glogowski (via logerrit) logerrit at kemper.freedesktop.org
Tue Nov 17 11:22:39 UTC 2020


 external/firebird/0001-Fix-warning-on-Win64-build-231.patch.1 |   37 ++++++++++
 external/firebird/UnpackedTarball_firebird.mk                 |    1 
 2 files changed, 38 insertions(+)

New commits:
commit 53cb928b168f6ef4b5af431a336f2b17f2a40604
Author:     Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Mon Nov 16 11:31:54 2020 +0100
Commit:     Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Tue Nov 17 12:22:03 2020 +0100

    firebird: fix Thread handle type on Windows
    
    MSVC compiler complains about 'warning C4312: "reinterpret_cast":
    conversion from "unsigned long" to "HANDLE" of greater size'.
    Seems like an real error, if real_handle is too small to hold the
    full "HANDLE" value, returned by _beginthreadex.
    
    Upstream strangely just fixed in master, not B3_0_Release branch.
    
    Change-Id: I87ad263529e119f68da976245646bf8b69efd35a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105924
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
    Reviewed-by: Jan-Marek Glogowski <glogow at fbihome.de>

diff --git a/external/firebird/0001-Fix-warning-on-Win64-build-231.patch.1 b/external/firebird/0001-Fix-warning-on-Win64-build-231.patch.1
new file mode 100644
index 000000000000..0e21f9e27925
--- /dev/null
+++ b/external/firebird/0001-Fix-warning-on-Win64-build-231.patch.1
@@ -0,0 +1,37 @@
+From 60cb8e07b17ad8533d7d13f52435aa11e48f4659 Mon Sep 17 00:00:00 2001
+From: Dimitry Sibiryakov <sd at ibphoenix.com>
+Date: Tue, 12 Nov 2019 13:42:49 +0100
+Subject: [PATCH] Fix warning on Win64 build (#231)
+
+---
+ src/common/ThreadStart.cpp | 11 +++++++----
+ 1 file changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/src/common/ThreadStart.cpp b/src/common/ThreadStart.cpp
+index 184c93a32b..758056432f 100644
+--- a/src/common/ThreadStart.cpp
++++ b/src/common/ThreadStart.cpp
+@@ -309,13 +309,16 @@ Thread Thread::start(ThreadEntryPoint* routine, void* arg, int priority_arg, Han
+ 	 * Advanced Windows by Richter pg. # 109. */
+ 
+ 	unsigned thread_id;
+-	unsigned long real_handle =
+-		_beginthreadex(NULL, 0, THREAD_ENTRYPOINT, THREAD_ARG, CREATE_SUSPENDED, &thread_id);
+-	if (!real_handle)
++	HANDLE handle =
++		reinterpret_cast<HANDLE>(_beginthreadex(NULL, 0, THREAD_ENTRYPOINT, THREAD_ARG, CREATE_SUSPENDED, &thread_id));
++	if (!handle)
+ 	{
++		// Though MSDN says that _beginthreadex() returns error in errno,
++		// GetLastError() still works because RTL call no other system
++		// functions after CreateThread() in the case of error.
++		// Watch out if it is ever changed.
+ 		Firebird::system_call_failed::raise("_beginthreadex", GetLastError());
+ 	}
+-	HANDLE handle = reinterpret_cast<HANDLE>(real_handle);
+ 
+ 	SetThreadPriority(handle, priority);
+ 
+-- 
+2.20.1
+
diff --git a/external/firebird/UnpackedTarball_firebird.mk b/external/firebird/UnpackedTarball_firebird.mk
index a3ee4bfe1835..a8507db387f1 100644
--- a/external/firebird/UnpackedTarball_firebird.mk
+++ b/external/firebird/UnpackedTarball_firebird.mk
@@ -36,6 +36,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,firebird,\
 		external/firebird/asan.patch \
 		external/firebird/firebird-tdf125284.patch.1 \
 		external/firebird/0001-Make-comparison-operator-member-functions-const.patch.1 \
+    external/firebird/0001-Fix-warning-on-Win64-build-231.patch.1 \
 ))
 
 ifeq ($(OS),WNT)


More information about the Libreoffice-commits mailing list