Skip to content

Commit c0ed11d

Browse files
committed
Fix Windows build
1 parent b1720ee commit c0ed11d

11 files changed

+35
-86
lines changed

src/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,5 @@ if(WIN32)
5959
endif()
6060

6161
add_library(code_src OBJECT ${SOURCES} ${HEADERS})
62+
target_link_libraries(code_src ${DEPLIBS})
63+

src/addon.cpp

+20-17
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,19 @@
2121
//---------------------------------------------------------------------------
2222

2323
#include "addon.h"
24-
24+
#include "channeladd.h"
25+
#include "channelsettings.h"
26+
#include "dabstream.h"
27+
#include "dbtypes.h"
28+
#include "filedevice.h"
29+
#include "fmstream.h"
30+
#include "hdstream.h"
2531
#include "stdafx.h"
32+
#include "sqlite_exception.h"
33+
#include "string_exception.h"
34+
#include "tcpdevice.h"
35+
#include "usbdevice.h"
36+
#include "wxstream.h"
2637

2738
#include <assert.h>
2839
#include <kodi/Filesystem.h>
@@ -35,25 +46,17 @@
3546
#include <rapidjson/prettywriter.h>
3647
#include <utility>
3748
#include <vector>
38-
// #include <version.h>
3949

40-
#ifdef __ANDROID__
41-
#include <android/log.h>
42-
#endif
50+
#ifdef WIN32
51+
#include <Windows.h>
4352

44-
#include "channeladd.h"
45-
#include "channelsettings.h"
46-
#include "dabstream.h"
47-
#include "dbtypes.h"
48-
#include "filedevice.h"
49-
#include "fmstream.h"
50-
#include "hdstream.h"
51-
#include "sqlite_exception.h"
52-
#include "string_exception.h"
53-
#include "tcpdevice.h"
54-
#include "usbdevice.h"
55-
#include "wxstream.h"
53+
#ifdef CreateDirectory
54+
#undef CreateDirectory
55+
#endif // CreateDirectory
5656

57+
#elif defined(__ANDROID__)
58+
#include <android/log.h>
59+
#endif
5760
#pragma warning(push, 4)
5861

5962
// Addon Entry Points

src/dabmuxscanner.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include "stdafx.h"
2626

2727
#include <algorithm>
28+
#include <assert.h>
2829
#include <stdexcept>
2930

3031
#pragma warning(push, 4)

src/filedevice.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222

2323
#include "filedevice.h"
2424

25-
#include "stdafx.h"
2625
#include "string_exception.h"
2726

27+
#include <assert.h>
2828
#include <chrono>
2929
#include <limits.h>
3030
#include <stdio.h>

src/hdmuxscanner.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include "stdafx.h"
2626

2727
#include <algorithm>
28+
#include <assert.h>
2829
#include <stdexcept>
2930

3031
#pragma warning(push, 4)

src/renderingcontrol.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,9 @@ class ATTR_DLL_LOCAL renderingcontrol : public kodi::gui::CAddonGUIControlBase
8787
// Stop (virtual)
8888
//
8989
// Stop the rendering process
90-
//virtual void Stop(void)
91-
//{
92-
//}
90+
virtual void Stop(void)
91+
{
92+
}
9393

9494
protected:
9595
//-------------------------------------------------------------------------

src/signalmeter.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include "stdafx.h"
2727
#include "string_exception.h"
2828

29+
#include <assert.h>
2930
#include <cmath>
3031
#include <string.h>
3132

src/stdafx.h

-60
Original file line numberDiff line numberDiff line change
@@ -24,66 +24,6 @@
2424
#define __STDAFX_H_
2525
#pragma once
2626

27-
//---------------------------------------------------------------------------
28-
// Windows
29-
//---------------------------------------------------------------------------
30-
31-
#if defined(_WINDOWS)
32-
33-
#define WINVER _WIN32_WINNT_WIN8
34-
#define _WIN32_WINNT _WIN32_WINNT_WIN8
35-
#define _WIN32_IE _WIN32_IE_IE80
36-
#define NOMINMAX
37-
38-
#include <WS2tcpip.h>
39-
#include <WinSock2.h>
40-
#include <Windows.h>
41-
#include <wchar.h> // Prevents redefinition of WCHAR_MIN by libusb
42-
43-
#define TARGET_WINDOWS
44-
#define HAS_ANGLE
45-
#define HAS_GLES 3 // ANGLE supports GLESv3
46-
47-
#define LIBANGLE_IMPLEMENTATION
48-
#define ANGLE_EXPORT
49-
#define ANGLE_UTIL_EXPORT
50-
#define EGLAPI
51-
#define GL_APICALL
52-
#define GL_API
53-
54-
#define GL_GLES_PROTOTYPES 1
55-
#define EGL_EGL_PROTOTYPES 1
56-
#define GL_GLEXT_PROTOTYPES 1
57-
#define EGL_EGLEXT_PROTOTYPES 1
58-
59-
// Android
60-
#elif defined(__ANDROID__)
61-
62-
#define TARGET_POSIX
63-
#define TARGET_LINUX
64-
#define TARGET_ANDROID
65-
#define HAS_GLES 3 // Android supports GLESv3
66-
67-
// MacOS
68-
#elif defined(__APPLE__)
69-
70-
#define TARGET_POSIX
71-
#define TARGET_DARWIN
72-
#define TARGET_DARWIN_OSX
73-
#define HAS_GL 1
74-
75-
// Linux
76-
#else
77-
78-
#define TARGET_POSIX
79-
#define TARGET_LINUX
80-
#define HAS_GLES 2 // Assume GLESv2 support on Linux
81-
82-
#endif
83-
84-
#include <assert.h>
85-
#include <stdint.h>
86-
8727
// KiB / MiB / GiB
8828
//
8929
#define KiB *(1 << 10)

src/tcpdevice.cpp

+5-3
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,13 @@
2222

2323
#include "tcpdevice.h"
2424

25-
#include "stdafx.h"
26-
2725
#include <algorithm>
26+
#include <assert.h>
2827
#ifdef WIN32
29-
#include <Winsock2.h>
28+
#include <WS2tcpip.h>
29+
#include <WinSock2.h>
30+
#include <Windows.h>
31+
#include <wchar.h> // Prevents redefinition of WCHAR_MIN by libusb
3032
#else
3133
#include <arpa/inet.h>
3234
#include <netdb.h>

src/win32_exception.cpp

-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@
2222

2323
#include "win32_exception.h"
2424

25-
#include "stdafx.h"
26-
2725
#pragma warning(push, 4)
2826

2927
//-----------------------------------------------------------------------------

src/win32_exception.h

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
#include <exception>
2828
#include <string>
29+
#include <windows.h>
2930

3031
#pragma warning(push, 4)
3132

0 commit comments

Comments
 (0)