From 5c9688e1526369159df2b4ee2639b07572d84413 Mon Sep 17 00:00:00 2001 From: Dimitre Date: Sun, 26 May 2024 18:06:48 -0300 Subject: [PATCH 1/7] byte --- libs/openFrameworks/utils/ofConstants.h | 1 + libs/openFrameworks/utils/ofSystemUtils.cpp | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/openFrameworks/utils/ofConstants.h b/libs/openFrameworks/utils/ofConstants.h index c80947718df..3c98f44d0fb 100644 --- a/libs/openFrameworks/utils/ofConstants.h +++ b/libs/openFrameworks/utils/ofConstants.h @@ -88,6 +88,7 @@ enum ofTargetPlatform{ // http://www.ogre3d.org/docs/api/html/OgrePlatform_8h-source.html #if defined( __WIN32__ ) || defined( _WIN32 ) + #include #define OF_OS_WINDOWS #define TARGET_WIN32 #if defined(_MSC_VER) diff --git a/libs/openFrameworks/utils/ofSystemUtils.cpp b/libs/openFrameworks/utils/ofSystemUtils.cpp index 33b530226cc..2629823a585 100644 --- a/libs/openFrameworks/utils/ofSystemUtils.cpp +++ b/libs/openFrameworks/utils/ofSystemUtils.cpp @@ -25,7 +25,6 @@ #define _WIN32_DCOM #include #include -#include #include #include #include From 69aff5d564cc8ff6ed2155a4e2200094e9649dbe Mon Sep 17 00:00:00 2001 From: Dimitre Date: Sun, 26 May 2024 20:33:56 -0300 Subject: [PATCH 2/7] update --- addons/ofxNetwork/src/ofxNetworkUtils.h | 6 ++++-- addons/ofxNetwork/src/ofxTCPManager.h | 5 ++++- addons/ofxNetwork/src/ofxUDPManager.h | 11 ++++++----- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/addons/ofxNetwork/src/ofxNetworkUtils.h b/addons/ofxNetwork/src/ofxNetworkUtils.h index 00d5dcec8b2..d9b63ba22c1 100644 --- a/addons/ofxNetwork/src/ofxNetworkUtils.h +++ b/addons/ofxNetwork/src/ofxNetworkUtils.h @@ -8,8 +8,6 @@ #pragma once #include -#include "ofConstants.h" - #ifdef TARGET_WIN32 #include @@ -19,6 +17,10 @@ #define OFXNETWORK_ERROR(name) E ## name #endif +// WinSock2.h has to be included before windows.h +#include "ofConstants.h" + + /** * @brief Log the latest network error and where it happened (file and line) * diff --git a/addons/ofxNetwork/src/ofxTCPManager.h b/addons/ofxNetwork/src/ofxTCPManager.h index 87acbffd40e..7c737da0508 100644 --- a/addons/ofxNetwork/src/ofxTCPManager.h +++ b/addons/ofxNetwork/src/ofxTCPManager.h @@ -42,7 +42,6 @@ SetTimeoutAccept() SetTimeoutReceive() ****************************************************************/ -#include "ofConstants.h" #include #include #include @@ -82,6 +81,10 @@ SetTimeoutReceive() #include // TCP/IP annex needed for multicasting #endif +// windows.h after winsock2.h +#include "ofConstants.h" + + //-------------------------------------------------------------------------------- class InetAddr : public sockaddr_in { diff --git a/addons/ofxNetwork/src/ofxUDPManager.h b/addons/ofxNetwork/src/ofxUDPManager.h index 49afb9ab2b6..2466f00af3d 100644 --- a/addons/ofxNetwork/src/ofxUDPManager.h +++ b/addons/ofxNetwork/src/ofxUDPManager.h @@ -62,11 +62,7 @@ UDP Multicast (receiving): x) Close() --------------------------------------------------------------------------------*/ -#include "ofConstants.h" -#include "ofxUDPSettings.h" -#include -#include -#include + #ifndef TARGET_WIN32 @@ -104,6 +100,11 @@ x) Close() /// Socket constants. #define SOCKET_TIMEOUT SOCKET_ERROR - 1 +#include "ofConstants.h" +#include "ofxUDPSettings.h" +#include +#include +#include //-------------------------------------------------------------------------------- //-------------------------------------------------------------------------------- From 429bbe723ecd2fbe3e63863fc6002600344a746c Mon Sep 17 00:00:00 2001 From: Dimitre Date: Sun, 26 May 2024 20:37:58 -0300 Subject: [PATCH 3/7] WIN32_LEAN_AND_MEAN --- libs/openFrameworks/utils/ofConstants.h | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/openFrameworks/utils/ofConstants.h b/libs/openFrameworks/utils/ofConstants.h index 3c98f44d0fb..78d8559dda8 100644 --- a/libs/openFrameworks/utils/ofConstants.h +++ b/libs/openFrameworks/utils/ofConstants.h @@ -88,6 +88,7 @@ enum ofTargetPlatform{ // http://www.ogre3d.org/docs/api/html/OgrePlatform_8h-source.html #if defined( __WIN32__ ) || defined( _WIN32 ) +#define WIN32_LEAN_AND_MEAN #include #define OF_OS_WINDOWS #define TARGET_WIN32 From 173ff4b817940c0533ee77fe8fdd0aee79e88d26 Mon Sep 17 00:00:00 2001 From: Dimitre Date: Sun, 26 May 2024 20:40:45 -0300 Subject: [PATCH 4/7] netdb.h --- addons/ofxNetwork/src/ofxUDPManager.h | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/ofxNetwork/src/ofxUDPManager.h b/addons/ofxNetwork/src/ofxUDPManager.h index 2466f00af3d..62d86c6948e 100644 --- a/addons/ofxNetwork/src/ofxUDPManager.h +++ b/addons/ofxNetwork/src/ofxUDPManager.h @@ -95,6 +95,7 @@ x) Close() //windows includes #include #include // TCP/IP annex needed for multicasting + #include #endif /// Socket constants. From 34c8c7decd1e9c488924e1550d2e3e74537634ad Mon Sep 17 00:00:00 2001 From: Dimitre Date: Sun, 26 May 2024 20:41:32 -0300 Subject: [PATCH 5/7] netdb.h --- addons/ofxNetwork/src/ofxUDPManager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/ofxNetwork/src/ofxUDPManager.h b/addons/ofxNetwork/src/ofxUDPManager.h index 62d86c6948e..3652c34740d 100644 --- a/addons/ofxNetwork/src/ofxUDPManager.h +++ b/addons/ofxNetwork/src/ofxUDPManager.h @@ -95,7 +95,7 @@ x) Close() //windows includes #include #include // TCP/IP annex needed for multicasting - #include +// #include #endif /// Socket constants. From af2997294f059af59736eed7e2c42253275968f2 Mon Sep 17 00:00:00 2001 From: Dimitre Date: Sun, 26 May 2024 20:43:22 -0300 Subject: [PATCH 6/7] order back to normal --- addons/ofxNetwork/src/ofxTCPManager.h | 5 +++-- addons/ofxNetwork/src/ofxUDPManager.h | 11 +++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/addons/ofxNetwork/src/ofxTCPManager.h b/addons/ofxNetwork/src/ofxTCPManager.h index 7c737da0508..88e95e34d37 100644 --- a/addons/ofxNetwork/src/ofxTCPManager.h +++ b/addons/ofxNetwork/src/ofxTCPManager.h @@ -42,6 +42,8 @@ SetTimeoutAccept() SetTimeoutReceive() ****************************************************************/ +#include "ofConstants.h" + #include #include #include @@ -81,8 +83,7 @@ SetTimeoutReceive() #include // TCP/IP annex needed for multicasting #endif -// windows.h after winsock2.h -#include "ofConstants.h" + //-------------------------------------------------------------------------------- diff --git a/addons/ofxNetwork/src/ofxUDPManager.h b/addons/ofxNetwork/src/ofxUDPManager.h index 3652c34740d..ba7ccc78e9d 100644 --- a/addons/ofxNetwork/src/ofxUDPManager.h +++ b/addons/ofxNetwork/src/ofxUDPManager.h @@ -62,6 +62,11 @@ UDP Multicast (receiving): x) Close() --------------------------------------------------------------------------------*/ +#include "ofConstants.h" +#include "ofxUDPSettings.h" +#include +#include +#include #ifndef TARGET_WIN32 @@ -95,17 +100,11 @@ x) Close() //windows includes #include #include // TCP/IP annex needed for multicasting -// #include #endif /// Socket constants. #define SOCKET_TIMEOUT SOCKET_ERROR - 1 -#include "ofConstants.h" -#include "ofxUDPSettings.h" -#include -#include -#include //-------------------------------------------------------------------------------- //-------------------------------------------------------------------------------- From fd922d3db0867e62279f17b8ca55b9e075e2e363 Mon Sep 17 00:00:00 2001 From: Dimitre Date: Sun, 26 May 2024 20:44:56 -0300 Subject: [PATCH 7/7] _WINSOCKAPI_ --- libs/openFrameworks/utils/ofConstants.h | 1 + 1 file changed, 1 insertion(+) diff --git a/libs/openFrameworks/utils/ofConstants.h b/libs/openFrameworks/utils/ofConstants.h index 78d8559dda8..79b7381cd41 100644 --- a/libs/openFrameworks/utils/ofConstants.h +++ b/libs/openFrameworks/utils/ofConstants.h @@ -89,6 +89,7 @@ enum ofTargetPlatform{ #if defined( __WIN32__ ) || defined( _WIN32 ) #define WIN32_LEAN_AND_MEAN +#define _WINSOCKAPI_ #include #define OF_OS_WINDOWS #define TARGET_WIN32