You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2021/08/01 19:18:08 UTC

[plc4x] 03/13: - Added the activating part of a workaround needed on Windows systems to compile C projects

This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a commit to branch feature/profinet-chris
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit a2231033f2b477020fb8b8a329df92cd67758345
Author: cdutz <ch...@c-ware.de>
AuthorDate: Sun Aug 1 19:49:31 2021 +0200

    - Added the activating part of a workaround needed on Windows systems to compile C projects
---
 plc4c/CMakeLists.txt | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/plc4c/CMakeLists.txt b/plc4c/CMakeLists.txt
index 4563b0c..5cf0693 100644
--- a/plc4c/CMakeLists.txt
+++ b/plc4c/CMakeLists.txt
@@ -34,6 +34,22 @@ set(BUILD_PHASE test-compile CACHE STRING "Phase of the Maven build we are execu
 # Access the Unity version the maven build is providing us with.
 set(UNITY_VERSION 2.5.0 CACHE STRING "Version of the used Unity test framework")
 
+# MinGW GCC versions above 4.7 on Windows include inline definitions of these functions
+# If you run into problems, please read this article: https://stackoverflow.com/questions/27853225/is-there-a-way-to-include-stdio-h-but-ignore-some-of-the-functions-therein
+# These are the constants needed to activate all patches.
+add_compile_definitions(NO_INLINE_VFSCANF=1)
+add_compile_definitions(NO_INLINE_VSSCANF=1)
+add_compile_definitions(NO_INLINE_VSCANF=1)
+add_compile_definitions(NO_INLINE_VSNPRINTF=1)
+add_compile_definitions(NO_INLINE_SNPRINTF=1)
+add_compile_definitions(NO_INLINE_VFWSCANF=1)
+add_compile_definitions(NO_INLINE_VSWSCANF=1)
+add_compile_definitions(NO_INLINE_VWSCANF=1)
+add_compile_definitions(NO_INLINE_SNWPRINTF=1)
+add_compile_definitions(NO_INLINE_VSNWPRINTF=1)
+add_compile_definitions(NO_INLINE_VSWPRINTF=1)
+add_compile_definitions(NO_INLINE_SWPRINTF=1)
+
 # Depending on the phase of the build we are currently running, initialize
 # The test system.
 if (BUILD_PHASE STREQUAL compile)