|
| 1 | +diff --git a/Makefile b/Makefile |
| 2 | +index d617cfc..0f395c9 100644 |
| 3 | +--- a/Makefile |
| 4 | ++++ b/Makefile |
| 5 | +@@ -23,14 +23,15 @@ OS := $(shell uname -s) |
| 6 | + |
| 7 | + # Variables with default values |
| 8 | + GPP?=g++ |
| 9 | ++AR?=ar |
| 10 | + |
| 11 | + # Variables extendable |
| 12 | +-CFLAGS+=-std=c++11 -Wall -Wno-reorder -Wno-terminate -Wno-unknown-pragmas -Wno-unknown-warning-option |
| 13 | ++CFLAGS+=-std=c++11 -Wall -Wno-reorder -Wno-terminate -Wno-unknown-pragmas |
| 14 | + ifeq ($(OS),FreeBSD) |
| 15 | + CFLAGS+=-D_GLIBCXX_USE_C99 |
| 16 | + endif |
| 17 | + override INCLUDES+=-I./include/ |
| 18 | +-LIBS+=-Wl,-Bdynamic -lcrypto -lssl -lpthread |
| 19 | ++LIBS+=-Wl,-Bdynamic -lcrypto -lssl -lpthread -lz |
| 20 | + |
| 21 | + INCDIR=/usr/include/librtmfp/ |
| 22 | + |
| 23 | +@@ -42,6 +43,11 @@ else |
| 24 | + LIBNAME=librtmfp.so |
| 25 | + SHARED=-shared |
| 26 | + endif |
| 27 | ++ |
| 28 | ++# mingw cross static |
| 29 | ++LIBNAME=librtmfp.a |
| 30 | ++SHARED= |
| 31 | ++ |
| 32 | + LIB=lib/$(LIBNAME) |
| 33 | + |
| 34 | + # Variables fixed |
| 35 | +@@ -55,8 +61,9 @@ release: |
| 36 | + mkdir -p tmp/Release/Base |
| 37 | + mkdir -p lib |
| 38 | + @$(MAKE) -k $(OBJECT) |
| 39 | +- @echo creating dynamic lib $(LIB) |
| 40 | +- @$(GPP) $(CFLAGS) $(LIBDIRS) -fPIC $(SHARED) -o $(LIB) $(OBJECT) $(LIBS) |
| 41 | ++ @echo creating static lib $(LIB) |
| 42 | ++ @$(AR) crf $(LIB) $(OBJECT) |
| 43 | ++ @echo was $(GPP) $(CFLAGS) $(LIBDIRS) -fPIC $(SHARED) -o $(LIB) $(OBJECT) $(LIBS) |
| 44 | + |
| 45 | + debug: |
| 46 | + mkdir -p tmp/Debug/Base |
| 47 | +@@ -90,4 +97,4 @@ $(OBJECTD): tmp/Debug/%.o: sources/%.cpp |
| 48 | + clean: |
| 49 | + @echo cleaning project librtmfp |
| 50 | + @rm -f $(OBJECT) $(LIB) |
| 51 | +- @rm -f $(OBJECTD) $(LIB) |
| 52 | +\ No newline at end of file |
| 53 | ++ @rm -f $(OBJECTD) $(LIB) |
| 54 | +diff --git a/include/Base/Date.h b/include/Base/Date.h |
| 55 | +index 209d3ce..ab2431a 100644 |
| 56 | +--- a/include/Base/Date.h |
| 57 | ++++ b/include/Base/Date.h |
| 58 | +@@ -19,6 +19,7 @@ details (or else see http://mozilla.org/MPL/2.0/). |
| 59 | + #include "Base/Mona.h" |
| 60 | + #include "Base/Time.h" |
| 61 | + #include "Base/Timezone.h" |
| 62 | ++#define __STDC_FORMAT_MACROS |
| 63 | + #include "inttypes.h" |
| 64 | + |
| 65 | + namespace Base { |
| 66 | +diff --git a/include/Base/Mona.h b/include/Base/Mona.h |
| 67 | +index d212a25..177184c 100644 |
| 68 | +--- a/include/Base/Mona.h |
| 69 | ++++ b/include/Base/Mona.h |
| 70 | +@@ -26,7 +26,11 @@ details (or else see http://mozilla.org/MPL/2.0/). |
| 71 | + #include <memory> |
| 72 | + #include <functional> |
| 73 | + #include <cmath> // C++ version of math.h to solve abs ambiguity over linux |
| 74 | +- |
| 75 | ++#include <mutex> |
| 76 | ++#include "winsock2.h" |
| 77 | ++#include "windows.h" |
| 78 | ++#include "Base/mingw-std-threads/mingw.mutex.h" |
| 79 | ++#include "Base/mingw-std-threads/mingw.condition_variable.h" |
| 80 | + |
| 81 | + ///// Usefull macros and patchs ////// |
| 82 | + |
| 83 | +@@ -43,12 +47,13 @@ details (or else see http://mozilla.org/MPL/2.0/). |
| 84 | + #define LINE_STRING STRINGIZE(__LINE__) |
| 85 | + |
| 86 | + #if defined(_WIN32) |
| 87 | +-#define _WINSOCKAPI_ // stops windows.h including winsock.h |
| 88 | +-#define NOMINMAX |
| 89 | ++//#define _WINSOCKAPI_ // stops windows.h including winsock.h |
| 90 | ++//#define NOMINMAX |
| 91 | ++#include "winsock2.h" |
| 92 | + #include "windows.h" |
| 93 | + #define sprintf sprintf_s |
| 94 | + #define snprintf sprintf_s |
| 95 | +-#define PATH_MAX 4096 // to match Linux! |
| 96 | ++// #define PATH_MAX 4096 // to match Linux! |
| 97 | + #define __BIG_ENDIAN__ 0 // windows is always little endian! |
| 98 | + #elif defined(__FreeBSD__) || defined(__APPLE__) || defined(__TOS_MACOS__) || defined(__NetBSD__) || defined(__OpenBSD__) |
| 99 | + #define _BSD 1 // Detect BSD system |
| 100 | +diff --git a/include/Base/Path.h b/include/Base/Path.h |
| 101 | +index 5a5291e..d562bda 100644 |
| 102 | +--- a/include/Base/Path.h |
| 103 | ++++ b/include/Base/Path.h |
| 104 | +@@ -19,6 +19,7 @@ details (or else see http://mozilla.org/MPL/2.0/). |
| 105 | + #include "Base/Mona.h" |
| 106 | + #include "Base/FileSystem.h" |
| 107 | + #include <mutex> |
| 108 | ++#include "Base/mingw-std-threads/mingw.mutex.h" |
| 109 | + |
| 110 | + namespace Base { |
| 111 | + |
| 112 | +diff --git a/include/Base/Thread.h b/include/Base/Thread.h |
| 113 | +index 5324da6..cfaef48 100644 |
| 114 | +--- a/include/Base/Thread.h |
| 115 | ++++ b/include/Base/Thread.h |
| 116 | +@@ -19,6 +19,7 @@ details (or else see http://mozilla.org/MPL/2.0/). |
| 117 | + #include "Base/Exceptions.h" |
| 118 | + #include "Base/Signal.h" |
| 119 | + #include <thread> |
| 120 | ++#include "Base/mingw-std-threads/mingw.mutex.h" |
| 121 | + |
| 122 | + namespace Base { |
| 123 | + |
| 124 | +diff --git a/include/librtmfp.h b/include/librtmfp.h |
| 125 | +index 50ff248..9a5e512 100644 |
| 126 | +--- a/include/librtmfp.h |
| 127 | ++++ b/include/librtmfp.h |
| 128 | +@@ -18,7 +18,7 @@ GNU Lesser General Public License for more details. |
| 129 | + You should have received a copy of the GNU Lesser General Public License |
| 130 | + along with Librtmfp. If not, see <http://www.gnu.org/licenses/>. |
| 131 | + */ |
| 132 | +- |
| 133 | ++#define LIBRTMFP_STATIC 1 |
| 134 | + #if defined(_WIN32) && !defined(LIBRTMFP_STATIC) |
| 135 | + // Windows DLL declaration |
| 136 | + #if defined(LIBRTMFP_EXPORT) |
| 137 | +diff --git a/sources/Base/IOSocket.cpp b/sources/Base/IOSocket.cpp |
| 138 | +index 8d904c3..60a7048 100644 |
| 139 | +--- a/sources/Base/IOSocket.cpp |
| 140 | ++++ b/sources/Base/IOSocket.cpp |
| 141 | +@@ -535,7 +535,7 @@ bool IOSocket::run(Exception& ex, const volatile bool& requestStop) { |
| 142 | + shared<Socket> pSocket; |
| 143 | + { |
| 144 | + lock_guard<mutex> lock(_mutexSockets); |
| 145 | +- auto& it = _sockets.find(msg.wParam); |
| 146 | ++ const auto& it = _sockets.find(msg.wParam); |
| 147 | + if (it != _sockets.end()) |
| 148 | + pSocket = it->second.lock(); |
| 149 | + } |
| 150 | +diff --git a/sources/Base/Timezone.cpp b/sources/Base/Timezone.cpp |
| 151 | +index 5313a37..f181e2a 100644 |
| 152 | +--- a/sources/Base/Timezone.cpp |
| 153 | ++++ b/sources/Base/Timezone.cpp |
| 154 | +@@ -494,7 +494,7 @@ Timezone::Timezone() : _offset(0),_dstOffset(3600000) { |
| 155 | + }); |
| 156 | + |
| 157 | + |
| 158 | +- auto& it = WindowToTZID.find(_name); |
| 159 | ++ const auto& it = WindowToTZID.find(_name); |
| 160 | + if (it != WindowToTZID.end()) |
| 161 | + _name.assign(it->second); |
| 162 | + } else |
0 commit comments