Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

mingw32 compilation - WIP (it just compiles)

  • Loading branch information...
commit c183637e8d1c68c6968c99c4d77b79483bb4a5d8 1 parent b51b6ff
@opdenkamp authored
Showing with 156 additions and 324 deletions.
  1. +11 −0 README
  2. +4 −0 addons/Makefile.include.am
  3. +1 −0  addons/pvr.argustv/src/KeepAliveThread.cpp
  4. +1 −0  addons/pvr.argustv/src/argustvrpc.cpp
  5. +1 −0  addons/pvr.argustv/src/lib/tsreader/FileReader.cpp
  6. +2 −2 addons/pvr.argustv/src/lib/tsreader/MultiFileReader.cpp
  7. +1 −1  addons/pvr.dvbviewer/src/xmlParser.cpp
  8. +0 −1  addons/pvr.hts/src/client.h
  9. +1 −1  addons/pvr.mediaportal.tvserver/src/Socket.cpp
  10. +3 −3 addons/pvr.mediaportal.tvserver/src/Socket.h
  11. +1 −0  addons/pvr.mediaportal.tvserver/src/lib/tsreader/FileReader.cpp
  12. +1 −1  addons/pvr.mediaportal.tvserver/src/lib/tsreader/MultiFileReader.cpp
  13. +3 −3 addons/pvr.nextpvr/src/Socket.cpp
  14. +3 −3 addons/pvr.nextpvr/src/Socket.h
  15. +1 −1  addons/pvr.vdr.vnsi/src/VNSIData.cpp
  16. +1 −0  addons/pvr.vdr.vnsi/src/VNSISession.cpp
  17. +19 −2 configure.ac
  18. +6 −1 lib/Makefile.am
  19. +4 −1 lib/libhts/Makefile.am
  20. +2 −2 lib/libhts/htsbuf.c
  21. +2 −2 lib/libhts/htsmsg.c
  22. +1 −1  lib/libhts/htsq.h
  23. +2 −2 lib/libhts/htsstr.c
  24. +39 −35 lib/platform/util/StdString.h
  25. +7 −0 lib/platform/windows/Makefile.am
  26. +3 −2 lib/platform/windows/dlfcn-win32.cpp
  27. +6 −0 lib/platform/windows/os-socket.h
  28. +7 −0 lib/platform/windows/os-threads.h
  29. +10 −9 lib/platform/windows/os-types.h
  30. +0 −247 lib/platform/windows/stdint.h
  31. +4 −0 lib/tinyxml/XMLUtils.h
  32. +1 −1  lib/tinyxml/tinyxml.cpp
  33. +7 −2 lib/tinyxml/tinyxml.h
  34. +1 −1  xbmc/libXBMC_addon.h
View
11 README
@@ -55,3 +55,14 @@ describe how to import the "xbmc-pvr-addons.sln" in "XBMC for Windows.sln"
XBMC Windows installer with included pvr addons:
------------------------------------------------
Not yet possible. Still a TODO.
+
+=============================
+ MingW
+=============================
+sudo apt-get install binutils-mingw-w64-i686 binutils-mingw-w64-x86-64 \
+ g++-mingw-w64-i686 gcc-mingw-w64 gcc-mingw-w64-i686 \
+ gcc-mingw-w64-x86-64 mingw-w64
+./bootstrap
+./configure --host=i686-w64-mingw32 --disable-shared --enable-static \
+ --enable-release --disable-external-ffmpeg --disable-addons-with-dependencies
+make
View
4 addons/Makefile.include.am
@@ -8,6 +8,10 @@ DEFINES = @ARCH_DEFINES@ -DUSE_DEMUX -D__STDC_CONSTANT_MACROS -D__STDC_F
AM_CXXFLAGS = -g -O2 -fPIC $(WARNINGS) $(DEFINES) @HOST_CXXFLAGS@
LIB = @abs_top_srcdir@/addons/$(ADDONNAME)/addon/@BINPREFIX@$(ADDONBINNAME)@BIN_EXT@
+if HOST_IS_WINDOWS
+ LIBS += @abs_top_srcdir@/lib/platform/windows/libpvrwindows.la
+endif
+
clean:
-rm -r -f $(LIB) @BINPREFIX@$(ADDONBINNAME)@BIN_EXT@ @abs_top_srcdir@/addons/$(ADDONNAME).@OS@-@ARCHITECTURE@.zip @abs_top_srcdir@/addons/.build/$(ADDONNAME) *.so *.lo *.o *.la *.a *.P *~
if IS_INTREE_BUILD
View
1  addons/pvr.argustv/src/KeepAliveThread.cpp
@@ -18,6 +18,7 @@
*
*/
+#include "platform/util/StdString.h"
#include "platform/os.h"
#include "client.h" //for XBMC->Log
#include "utils.h"
View
1  addons/pvr.argustv/src/argustvrpc.cpp
@@ -23,6 +23,7 @@
* Tested under Windows and Linux
*/
+#include "platform/util/StdString.h"
#include <stdio.h>
#include <sys/stat.h>
#include "platform/os.h"
View
1  addons/pvr.argustv/src/lib/tsreader/FileReader.cpp
@@ -32,6 +32,7 @@
* http://forums.dvbowners.com/
*/
+#include "platform/util/StdString.h"
#include "FileReader.h"
#include "client.h" //for XBMC->Log
#include <algorithm> //std::min, std::max
View
4 addons/pvr.argustv/src/lib/tsreader/MultiFileReader.cpp
@@ -32,17 +32,17 @@
* http://forums.dvbowners.com/
*/
+#include "platform/util/StdString.h"
#include "MultiFileReader.h"
#include "client.h" //for XBMC->Log
#include <string>
#include "utils.h"
#include <algorithm>
#include "platform/util/timeutils.h"
-#include "platform/util/StdString.h"
#include <limits.h>
-#if !defined(TARGET_WINDOWS)
+#if !defined(TARGET_WINDOWS) && !defined(__MINGW32__)
#include <sys/time.h>
#include "platform/os.h"
#define SUCCEEDED(hr) (((HRESULT)(hr)) >= 0)
View
2  addons/pvr.dvbviewer/src/xmlParser.cpp
@@ -59,7 +59,7 @@
//#include <crtdbg.h>
//#endif
#define WIN32_LEAN_AND_MEAN
-#include <Windows.h> // to have IsTextUnicode, MultiByteToWideChar, WideCharToMultiByte to handle unicode files
+#include <windows.h> // to have IsTextUnicode, MultiByteToWideChar, WideCharToMultiByte to handle unicode files
// to have "MessageBoxA" to display error messages for openFilHelper
#endif
View
1  addons/pvr.hts/src/client.h
@@ -20,7 +20,6 @@
*
*/
-#include "platform/os.h"
#include "libXBMC_addon.h"
#include "libXBMC_pvr.h"
#include "libXBMC_gui.h"
View
2  addons/pvr.mediaportal.tvserver/src/Socket.cpp
@@ -496,7 +496,7 @@ bool Socket::is_valid() const
return (_sd != INVALID_SOCKET);
}
-#if defined(TARGET_WINDOWS)
+#if defined(TARGET_WINDOWS) || defined(__MINGW32__)
bool Socket::set_non_blocking ( const bool b )
{
u_long iMode;
View
6 addons/pvr.mediaportal.tvserver/src/Socket.h
@@ -22,7 +22,7 @@ namespace MPTV //Prevent name clash with Live555 Socket
{
//Include platform specific datatypes, header files, defines and constants:
-#if defined TARGET_WINDOWS
+#if defined TARGET_WINDOWS || defined(__MINGW32__)
#define WIN32_LEAN_AND_MEAN // Enable LEAN_AND_MEAN support
#pragma warning(disable:4005) // Disable "warning C4005: '_WINSOCKAPI_' : macro redefinition"
#include <winsock2.h>
@@ -88,7 +88,7 @@ enum SocketFamily
enum SocketDomain
{
- #if defined TARGET_LINUX || defined TARGET_DARWIN
+ #if (defined TARGET_LINUX || defined TARGET_DARWIN) && !defined(__MINGW32__)
pf_unix = PF_UNIX,
pf_local = PF_LOCAL,
#endif
@@ -296,7 +296,7 @@ class Socket
enum SocketType _type; ///< Socket Type
enum SocketDomain _domain; ///< Socket domain
- #ifdef TARGET_WINDOWS
+ #if defined(TARGET_WINDOWS) || defined(__MINGW32__)
WSADATA _wsaData; ///< Windows Socket data
static int win_usage_count; ///< Internal Windows usage counter used to prevent a global WSACleanup when more than one Socket object is used
#endif
View
1  addons/pvr.mediaportal.tvserver/src/lib/tsreader/FileReader.cpp
@@ -32,6 +32,7 @@
* http://forums.dvbowners.com/
*/
+#include "platform/util/StdString.h"
#include "FileReader.h"
#include "client.h" //for XBMC->Log
#include "platform/threads/threads.h"
View
2  addons/pvr.mediaportal.tvserver/src/lib/tsreader/MultiFileReader.cpp
@@ -32,13 +32,13 @@
* http://forums.dvbowners.com/
*/
+#include "platform/util/StdString.h"
#include "MultiFileReader.h"
#include "client.h" //for XBMC->Log
#include <string>
#include "utils.h"
#include <algorithm>
#include "platform/util/timeutils.h"
-#include "platform/util/StdString.h"
#include "platform/threads/threads.h"
#include <inttypes.h>
View
6 addons/pvr.nextpvr/src/Socket.cpp
@@ -103,7 +103,7 @@ bool Socket::close()
if (is_valid())
{
if (_sd != SOCKET_ERROR)
-#ifdef TARGET_WINDOWS
+#if defined(TARGET_WINDOWS) || defined(__MINGW32__)
closesocket(_sd);
#else
::close(_sd);
@@ -434,7 +434,7 @@ int Socket::receive ( char* data, const unsigned int buffersize, const unsigned
if ( status == SOCKET_ERROR )
{
int lasterror = getLastError();
-#if defined(TARGET_WINDOWS)
+#if defined(TARGET_WINDOWS) || defined(__MINGW32__)
if ( lasterror != WSAEWOULDBLOCK)
errormessage( lasterror, "Socket::receive" );
#else
@@ -516,7 +516,7 @@ bool Socket::is_valid() const
return (_sd != INVALID_SOCKET);
}
-#if defined(TARGET_WINDOWS)
+#if defined(TARGET_WINDOWS) || defined(__MINGW32__)
bool Socket::set_non_blocking ( const bool b )
{
u_long iMode;
View
6 addons/pvr.nextpvr/src/Socket.h
@@ -22,7 +22,7 @@ namespace NextPVR
{
//Include platform specific datatypes, header files, defines and constants:
-#if defined TARGET_WINDOWS
+#if defined TARGET_WINDOWS || defined(__MINGW32__)
#define WIN32_LEAN_AND_MEAN // Enable LEAN_AND_MEAN support
#pragma warning(disable:4005) // Disable "warning C4005: '_WINSOCKAPI_' : macro redefinition"
#include <winsock2.h>
@@ -85,7 +85,7 @@ enum SocketFamily
enum SocketDomain
{
- #if defined TARGET_LINUX || defined TARGET_DARWIN
+ #if (defined TARGET_LINUX || defined TARGET_DARWIN) && !defined(__MINGW32__)
pf_unix = PF_UNIX,
pf_local = PF_LOCAL,
#endif
@@ -295,7 +295,7 @@ class Socket
enum SocketType _type; ///< Socket Type
enum SocketDomain _domain; ///< Socket domain
- #ifdef TARGET_WINDOWS
+ #if defined(TARGET_WINDOWS) || defined(__MINGW32__)
WSADATA _wsaData; ///< Windows Socket data
static int win_usage_count; ///< Internal Windows usage counter used to prevent a global WSACleanup when more than one Socket object is used
#endif
View
2  addons/pvr.vdr.vnsi/src/VNSIData.cpp
@@ -19,11 +19,11 @@
*
*/
+#include "platform/util/StdString.h"
#include "VNSIData.h"
#include "responsepacket.h"
#include "requestpacket.h"
#include "vnsicommand.h"
-#include "platform/util/StdString.h"
using namespace ADDON;
using namespace PLATFORM;
View
1  addons/pvr.vdr.vnsi/src/VNSISession.cpp
@@ -19,6 +19,7 @@
*
*/
+#include "platform/util/StdString.h"
#include "VNSISession.h"
#include "client.h"
View
21 configure.ac
@@ -14,7 +14,6 @@ AC_PROG_CXX
AC_PROG_CPP
AC_PROG_LIBTOOL
-AC_SEARCH_LIBS([pthread_create],[pthread],, AC_MSG_ERROR([required library 'pthread' is missing]))
AC_ARG_ENABLE([release],
[AS_HELP_STRING([--enable-release],
@@ -62,7 +61,7 @@ DYN_LIB_EXT="so"
TARGET_LDFLAGS=""
BIN_EXT=".pvr"
BINPREFIX=""
-case "${host}" in
+case "${target}" in
arm-*-linux-androideabi)
TARGET_LDFLAGS="-avoid-version -no-undefined"
OS="android"
@@ -119,8 +118,19 @@ case "${host}" in
OS="freebsd"
ARCH_DEFINES="-DTARGET_POSIX -DTARGET_FREEBSD -D_LINUX"
;;
+ *mingw*)
+ OS="wingl"
+ DYN_LIB_EXT="a"
+ AC_DEFINE([__MINGW32__], [1], ["mingw32 build"])
+ ;;
esac
+if test "$OS" = "wingl"; then
+ echo "Using Windows threading"
+else
+ AC_SEARCH_LIBS([pthread_create],[pthread],, AC_MSG_ERROR([required library 'pthread' is missing]))
+fi
+
### External libraries checks
# FFmpeg
if test "$use_external_ffmpeg" = "yes"; then
@@ -235,6 +245,12 @@ else
AM_CONDITIONAL(HOST_IS_OSX, false)
fi
+if test "x$OS" = "xwingl"; then
+ AM_CONDITIONAL(HOST_IS_WINDOWS, true)
+else
+ AM_CONDITIONAL(HOST_IS_WINDOWS, false)
+fi
+
if test "x${libdir}" != 'x${exec_prefix}/lib'; then
LIBDIR=${libdir}
elif test "$prefix" = "NONE"; then
@@ -261,6 +277,7 @@ AC_CONFIG_FILES([Makefile \
lib/cmyth/Makefile \
lib/cmyth/libcmyth/Makefile \
lib/cmyth/librefmem/Makefile \
+ lib/platform/windows/Makefile \
addons/Makefile \
addons/pvr.demo/Makefile \
addons/pvr.dvbviewer/Makefile \
View
7 lib/Makefile.am
@@ -1,5 +1,10 @@
+ADDITIONAL_SUBDIRS =
if ADDON_MYTHTV
- ADDITIONAL_SUBDIRS = cmyth
+ ADDITIONAL_SUBDIRS += cmyth
+endif
+
+if HOST_IS_WINDOWS
+ ADDITIONAL_SUBDIRS += platform/windows
endif
SUBDIRS = libhts tinyxml jsoncpp $(ADDITIONAL_SUBDIRS)
View
5 lib/libhts/Makefile.am
@@ -4,9 +4,12 @@ libhts_la_SOURCES = htsmsg.c \
htsmsg_binary.c \
htsbuf.c \
htsstr.c \
- net_posix.c \
sha1.c
+if !HOST_IS_WINDOWS
+ libhts_la_SOURCES += net_posix.c
+endif
+
libhts_la_CPPFLAGS=-std=c99 -D_GNU_SOURCE
$(LIB): libhts.la
View
4 lib/libhts/htsbuf.c
@@ -24,8 +24,8 @@
#include <string.h>
#include <stdarg.h>
#include "htsbuf.h"
-#ifdef _MSC_VER
-#include "msvc.h"
+#if defined(_MSC_VER) || defined(__MINGW32__)
+#include "Win32/include/msvc.h"
#endif
#ifndef MIN
View
4 lib/libhts/htsmsg.c
@@ -25,8 +25,8 @@
#include <stdarg.h>
#include <string.h>
-#ifdef _MSC_VER
-#include "msvc.h"
+#if defined(_MSC_VER) || defined(__MINGW32__)
+#include "Win32/include/msvc.h"
#endif
#include "htsmsg.h"
View
2  lib/libhts/htsq.h
@@ -5,7 +5,7 @@
#ifndef HTSQ_H
#define HTSQ_H
-#ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__MINGW32__)
#undef SLIST_ENTRY
#include "Win32/include/sys/queue.h"
#else
View
4 lib/libhts/htsstr.c
@@ -23,8 +23,8 @@
#include <string.h>
#ifdef __APPLE__
#include "OSXGNUReplacements.h"
-#elif defined(_MSC_VER)
-#include "msvc.h"
+#elif defined(_MSC_VER) || defined(__MINGW32__)
+#include "Win32/include/msvc.h"
#endif
#include "htsstr.h"
View
74 lib/platform/util/StdString.h
@@ -1,7 +1,5 @@
#pragma once
-#include "../os.h"
-#include <string>
-#include <stdint.h>
+
#include <vector>
#if defined(_WIN32) && !defined(va_copy)
@@ -634,8 +632,8 @@ inline const Type& SSMAX(const Type& arg1, const Type& arg2)
#else // ...else SS_ANSI is NOT defined
- #include <TCHAR.H>
- #include <WTYPES.H>
+ #include <tchar.h>
+ #include <wtypes.h>
#ifndef STRICT
#define STRICT
#endif
@@ -643,8 +641,13 @@ inline const Type& SSMAX(const Type& arg1, const Type& arg2)
// Make sure ASSERT and verify are defined
#ifndef ASSERT
- #include <crtdbg.h>
- #define ASSERT(f) _ASSERTE((f))
+ #if !defined(__MINGW32__)
+ #include <crtdbg.h>
+ #define ASSERT(f) _ASSERTE((f))
+ #else
+ #include <cassert>
+ #define ASSERT(f) assert(f)
+ #endif
#endif
#ifndef VERIFY
#ifdef _DEBUG
@@ -664,6 +667,7 @@ inline const Type& SSMAX(const Type& arg1, const Type& arg2)
// Standard headers needed
+#include <stdint.h>
#include <string> // basic_string
#include <algorithm> // for_each, etc.
#include <functional> // for StdStringLessNoCase, et al
@@ -948,7 +952,7 @@ inline const Type& SSMAX(const Type& arg1, const Type& arg2)
// know that's only Microsoft's though I've heard that the function exists
// elsewhere.
-#if defined(SS_ALLOCA) && !defined SS_NO_CONVERSION
+#if defined(SS_ALLOCA) && !defined SS_NO_CONVERSION || defined(__MINGW32__)
#include <malloc.h> // needed for _alloca
@@ -1593,7 +1597,7 @@ inline void ssupr(CT* pT, size_t nLen, const std::locale& loc=std::locale())
// GNU is supposed to have vsnprintf and vsnwprintf. But only the newer
// distributions do.
-#if defined(__GNUC__)
+#if defined(__GNUC__) && !defined(__MINGW32__)
inline int ssvsprintf(PSTR pA, size_t nCount, PCSTR pFmtA, va_list vl)
{
@@ -1605,7 +1609,7 @@ inline void ssupr(CT* pT, size_t nLen, const std::locale& loc=std::locale())
}
// Microsofties can use
-#elif defined(_MSC_VER) && !defined(SS_ANSI)
+#elif (defined(_MSC_VER) || defined(__MINGW32__)) && !defined(SS_ANSI)
inline int ssvsprintf(PSTR pA, size_t nCount, PCSTR pFmtA, va_list vl)
{
@@ -1688,7 +1692,7 @@ inline void ssupr(CT* pT, size_t nLen, const std::locale& loc=std::locale())
inline int ssnprintf(PSTR pA, size_t nCount, PCSTR pFmtA, va_list vl)
{
- #ifdef _MSC_VER
+ #if defined(_MSC_VER) || defined(__MINGW32__)
return _vsnprintf(pA, nCount, pFmtA, vl);
#else
return vsnprintf(pA, nCount, pFmtA, vl);
@@ -1696,7 +1700,7 @@ inline void ssupr(CT* pT, size_t nLen, const std::locale& loc=std::locale())
}
inline int ssnprintf(PWSTR pW, size_t nCount, PCWSTR pFmtW, va_list vl)
{
- #ifdef _MSC_VER
+#if defined(_MSC_VER) || defined(__MINGW32__)
return _vsnwprintf(pW, nCount, pFmtW, vl);
#else
return vswprintf(pW, nCount, pFmtW, vl);
@@ -2050,7 +2054,7 @@ class CStdStr : public std::basic_string<CT>
{
bool bLoaded = false;
-#if defined(SS_WIN32) && !defined(SS_ANSI)
+#if defined(SS_WIN32) && !defined(SS_ANSI) && !defined(__MINGW32__)
if ( ( pT != NULL ) && SS_IS_INTRESOURCE(pT) )
{
UINT nId = LOWORD(reinterpret_cast<unsigned long>(pT));
@@ -2098,7 +2102,7 @@ class CStdStr : public std::basic_string<CT>
CStdStr(PCSTR pA)
{
- #ifdef SS_ANSI
+ #if defined(SS_ANSI) || defined(__MINGW32__)
*this = pA;
#else
if ( !TryLoad(pA) )
@@ -2108,7 +2112,7 @@ class CStdStr : public std::basic_string<CT>
CStdStr(PCWSTR pW)
{
- #ifdef SS_ANSI
+ #if defined(SS_ANSI) || defined(__MINGW32__)
*this = pW;
#else
if ( !TryLoad(pW) )
@@ -2118,7 +2122,7 @@ class CStdStr : public std::basic_string<CT>
CStdStr(uint16_t* pW)
{
- #ifdef SS_ANSI
+ #if defined(SS_ANSI) || defined(__MINGW32__)
*this = pW;
#else
if ( !TryLoad(pW) )
@@ -2128,7 +2132,7 @@ class CStdStr : public std::basic_string<CT>
CStdStr(uint32_t* pW)
{
- #ifdef SS_ANSI
+ #if defined(SS_ANSI) || defined(__MINGW32__)
*this = pW;
#else
if ( !TryLoad(pW) )
@@ -2509,7 +2513,7 @@ class CStdStr : public std::basic_string<CT>
// true if successful, false otherwise
// -------------------------------------------------------------------------
-#ifndef SS_ANSI
+#if !defined(SS_ANSI) && !defined(__MINGW32__)
bool Load(UINT nId, HMODULE hModule=NULL)
{
@@ -3189,7 +3193,7 @@ class CStdStr : public std::basic_string<CT>
// The following methods are intended to allow you to use this class as a
// near drop-in replacement for CString.
// -------------------------------------------------------------------------
- #ifdef SS_WIN32
+ #if defined(SS_WIN32) && !defined(__MINGW32__)
BSTR AllocSysString() const
{
ostring os;
@@ -3284,7 +3288,7 @@ class CStdStr : public std::basic_string<CT>
reinterpret_cast<PMYSTR>(&szTemp), 0, &argList) == 0 ||
szTemp == 0 )
{
- throw std::runtime_error("out of memory");
+ throw std::exception("out of memory");
}
*this = szTemp;
LocalFree(szTemp);
@@ -3303,7 +3307,7 @@ class CStdStr : public std::basic_string<CT>
reinterpret_cast<PMYSTR>(&szTemp), 0, &argList) == 0 ||
szTemp == 0)
{
- throw std::runtime_error("out of memory");
+ throw std::exception("out of memory");
}
*this = szTemp;
LocalFree(szTemp);
@@ -3533,7 +3537,7 @@ class CStdStr : public std::basic_string<CT>
this->at(static_cast<MYSIZE>(nIndex)) = ch;
}
-#ifndef SS_ANSI
+#if !defined(SS_ANSI) && !defined(__MINGW32__)
BSTR SetSysString(BSTR* pbstr) const
{
ostring os;
@@ -3558,7 +3562,7 @@ class CStdStr : public std::basic_string<CT>
return pos == MYBASE::npos ? *this : Left(pos);
}
-#if defined SS_WIN32 && !defined(UNICODE) && !defined(SS_ANSI)
+#if defined SS_WIN32 && !defined(UNICODE) && !defined(SS_ANSI) && !defined(__MINGW32__)
// CString's OemToAnsi and AnsiToOem functions are available only in
// Unicode builds. However since we're a template we also need a
@@ -3837,7 +3841,7 @@ class CStdStr : public std::basic_string<CT>
}
#endif // #ifdef SS_INC_COMDEF
-#ifndef SS_ANSI
+#if !defined(SS_ANSI) && !defined(__MINGW32__)
// SetResourceHandle/GetResourceHandle. In MFC builds, these map directly
// to AfxSetResourceHandle and AfxGetResourceHandle. In non-MFC builds they
@@ -4131,7 +4135,7 @@ struct FmtArg<std::wstring>
// This function allows the caller for format and return a CStdStringA
// object with a single line of code.
// -----------------------------------------------------------------------------
-#ifdef SS_ANSI
+#if defined(SS_ANSI) || defined(__MINGW32__)
#else
inline CStdStringA WUFormatA(UINT nId, ...)
{
@@ -4146,15 +4150,6 @@ struct FmtArg<std::wstring>
va_end(argList);
return strOut;
}
- inline CStdStringA WUFormatA(PCSTR szFormat, ...)
- {
- va_list argList;
- va_start(argList, szFormat);
- CStdStringA strOut;
- strOut.FormatV(szFormat, argList);
- va_end(argList);
- return strOut;
- }
inline CStdStringW WUFormatW(UINT nId, ...)
{
va_list argList;
@@ -4168,6 +4163,16 @@ struct FmtArg<std::wstring>
va_end(argList);
return strOut;
}
+#endif // #ifdef SS_ANSI
+ inline CStdStringA WUFormatA(PCSTR szFormat, ...)
+ {
+ va_list argList;
+ va_start(argList, szFormat);
+ CStdStringA strOut;
+ strOut.FormatV(szFormat, argList);
+ va_end(argList);
+ return strOut;
+ }
inline CStdStringW WUFormatW(PCWSTR szwFormat, ...)
{
va_list argList;
@@ -4177,7 +4182,6 @@ struct FmtArg<std::wstring>
va_end(argList);
return strOut;
}
-#endif // #ifdef SS_ANSI
View
7 lib/platform/windows/Makefile.am
@@ -0,0 +1,7 @@
+noinst_LTLIBRARIES = libpvrwindows.la
+
+libpvrwindows_la_SOURCES = dlfcn-win32.cpp os-threads.cpp
+
+$(LIB): libpvrwindows.la
+ cp -f .libs/libpvrwindows.a .
+ cp -f .libs/libpvrwindows.la $(LIB)
View
5 lib/platform/windows/dlfcn-win32.cpp
@@ -21,6 +21,7 @@
#include <stdio.h>
#include "dlfcn-win32.h"
+#include "../os.h"
/* Note:
* MSDN says these functions are not thread-safe. We make no efforts to have
@@ -99,7 +100,7 @@ void *dlopen( const char *file, int mode )
if( file == 0 )
{
/* Save NULL pointer for error message */
- _snprintf_s( last_name, MAX_PATH, MAX_PATH, "0x%p", file );
+ _snprintf( last_name, MAX_PATH, "0x%p", file );
/* POSIX says that if the value of file is 0, a handle on a global
* symbol object must be provided. That object must be able to access
@@ -162,7 +163,7 @@ int dlclose( void *handle )
BOOL ret;
/* Save handle for error message */
- _snprintf_s( last_name, MAX_PATH, MAX_PATH, "0x%p", handle );
+ _snprintf( last_name, MAX_PATH, "0x%p", handle );
ret = FreeLibrary( hModule );
View
6 lib/platform/windows/os-socket.h
@@ -43,6 +43,12 @@
#ifndef ETIMEDOUT
#define ETIMEDOUT 138
#endif
+#ifndef EINPROGRESS
+#define EINPROGRESS 112
+#endif
+#ifndef ECONNRESET
+#define ECONNRESET 108
+#endif
namespace PLATFORM
{
View
7 lib/platform/windows/os-threads.h
@@ -31,6 +31,13 @@
* http://www.pulse-eight.net/
*/
+#if defined(__MINGW32__)
+typedef struct _RTL_CONDITION_VARIABLE {
+ PVOID Ptr;
+} RTL_CONDITION_VARIABLE, *PRTL_CONDITION_VARIABLE;
+typedef RTL_CONDITION_VARIABLE CONDITION_VARIABLE, *PCONDITION_VARIABLE;
+#endif
+
namespace PLATFORM
{
#define thread_t HANDLE
View
19 lib/platform/windows/os-types.h
@@ -35,14 +35,19 @@
#define __WINDOWS__
#endif
-#ifndef _WINSOCKAPI_
-#define _WINSOCKAPI_
-#endif
-
#define WIN32_LEAN_AND_MEAN // Enable LEAN_AND_MEAN support
+#ifndef NOMINMAX
#define NOMINMAX // don't define min() and max() to prevent a clash with std::min() and std::max
+#endif
+
+#pragma warning(disable:4005) // Disable "warning C4005: '_WINSOCKAPI_' : macro redefinition"
+#include <winsock2.h>
+#pragma warning(default:4005)
+
#include <windows.h>
+#ifndef __MINGW32__
#include <wchar.h>
+#endif
/* String to 64-bit int */
#define atoll(S) _atoi64(S)
@@ -58,10 +63,6 @@
#define WcsToMbs wcstombs
typedef wchar_t Wchar_t; /* sizeof(wchar_t) = 2 bytes on Windows */
-#pragma warning(disable:4005) // Disable "warning C4005: '_WINSOCKAPI_' : macro redefinition"
-#include <winsock2.h>
-#pragma warning(default:4005)
-
#include <sys/timeb.h>
#include <io.h>
#include <stdlib.h>
@@ -78,7 +79,7 @@ typedef HANDLE serial_socket_t;
#ifndef _SSIZE_T_DEFINED
#ifdef _WIN64
typedef __int64 ssize_t;
-#else
+#elif !defined(__MINGW32__)
typedef _W64 int ssize_t;
#endif
#define _SSIZE_T_DEFINED
View
247 lib/platform/windows/stdint.h
@@ -1,247 +0,0 @@
-// ISO C9x compliant stdint.h for Microsoft Visual Studio
-// Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124
-//
-// Copyright (c) 2006-2008 Alexander Chemeris
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions are met:
-//
-// 1. Redistributions of source code must retain the above copyright notice,
-// this list of conditions and the following disclaimer.
-//
-// 2. Redistributions in binary form must reproduce the above copyright
-// notice, this list of conditions and the following disclaimer in the
-// documentation and/or other materials provided with the distribution.
-//
-// 3. The name of the author may be used to endorse or promote products
-// derived from this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
-// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
-// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-///////////////////////////////////////////////////////////////////////////////
-
-#ifndef _MSC_VER // [
-#error "Use this header only with Microsoft Visual C++ compilers!"
-#endif // _MSC_VER ]
-
-#ifndef _MSC_STDINT_H_ // [
-#define _MSC_STDINT_H_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif
-
-#include <limits.h>
-
-// For Visual Studio 6 in C++ mode and for many Visual Studio versions when
-// compiling for ARM we should wrap <wchar.h> include with 'extern "C++" {}'
-// or compiler give many errors like this:
-// error C2733: second C linkage of overloaded function 'wmemchr' not allowed
-#ifdef __cplusplus
-extern "C" {
-#endif
-# include <wchar.h>
-#ifdef __cplusplus
-}
-#endif
-
-// Define _W64 macros to mark types changing their size, like intptr_t.
-#ifndef _W64
-# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300
-# define _W64 __w64
-# else
-# define _W64
-# endif
-#endif
-
-
-// 7.18.1 Integer types
-
-// 7.18.1.1 Exact-width integer types
-
-// Visual Studio 6 and Embedded Visual C++ 4 doesn't
-// realize that, e.g. char has the same size as __int8
-// so we give up on __intX for them.
-#if (_MSC_VER < 1300)
- typedef signed char int8_t;
- typedef signed short int16_t;
- typedef signed int int32_t;
- typedef unsigned char uint8_t;
- typedef unsigned short uint16_t;
- typedef unsigned int uint32_t;
-#else
- typedef signed __int8 int8_t;
- typedef signed __int16 int16_t;
- typedef signed __int32 int32_t;
- typedef unsigned __int8 uint8_t;
- typedef unsigned __int16 uint16_t;
- typedef unsigned __int32 uint32_t;
-#endif
-typedef signed __int64 int64_t;
-typedef unsigned __int64 uint64_t;
-
-
-// 7.18.1.2 Minimum-width integer types
-typedef int8_t int_least8_t;
-typedef int16_t int_least16_t;
-typedef int32_t int_least32_t;
-typedef int64_t int_least64_t;
-typedef uint8_t uint_least8_t;
-typedef uint16_t uint_least16_t;
-typedef uint32_t uint_least32_t;
-typedef uint64_t uint_least64_t;
-
-// 7.18.1.3 Fastest minimum-width integer types
-typedef int8_t int_fast8_t;
-typedef int16_t int_fast16_t;
-typedef int32_t int_fast32_t;
-typedef int64_t int_fast64_t;
-typedef uint8_t uint_fast8_t;
-typedef uint16_t uint_fast16_t;
-typedef uint32_t uint_fast32_t;
-typedef uint64_t uint_fast64_t;
-
-// 7.18.1.4 Integer types capable of holding object pointers
-#ifdef _WIN64 // [
- typedef signed __int64 intptr_t;
- typedef unsigned __int64 uintptr_t;
-#else // _WIN64 ][
- typedef _W64 signed int intptr_t;
- typedef _W64 unsigned int uintptr_t;
-#endif // _WIN64 ]
-
-// 7.18.1.5 Greatest-width integer types
-typedef int64_t intmax_t;
-typedef uint64_t uintmax_t;
-
-
-// 7.18.2 Limits of specified-width integer types
-
-#if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259
-
-// 7.18.2.1 Limits of exact-width integer types
-#define INT8_MIN ((int8_t)_I8_MIN)
-#define INT8_MAX _I8_MAX
-#define INT16_MIN ((int16_t)_I16_MIN)
-#define INT16_MAX _I16_MAX
-#define INT32_MIN ((int32_t)_I32_MIN)
-#define INT32_MAX _I32_MAX
-#define INT64_MIN ((int64_t)_I64_MIN)
-#define INT64_MAX _I64_MAX
-#define UINT8_MAX _UI8_MAX
-#define UINT16_MAX _UI16_MAX
-#define UINT32_MAX _UI32_MAX
-#define UINT64_MAX _UI64_MAX
-
-// 7.18.2.2 Limits of minimum-width integer types
-#define INT_LEAST8_MIN INT8_MIN
-#define INT_LEAST8_MAX INT8_MAX
-#define INT_LEAST16_MIN INT16_MIN
-#define INT_LEAST16_MAX INT16_MAX
-#define INT_LEAST32_MIN INT32_MIN
-#define INT_LEAST32_MAX INT32_MAX
-#define INT_LEAST64_MIN INT64_MIN
-#define INT_LEAST64_MAX INT64_MAX
-#define UINT_LEAST8_MAX UINT8_MAX
-#define UINT_LEAST16_MAX UINT16_MAX
-#define UINT_LEAST32_MAX UINT32_MAX
-#define UINT_LEAST64_MAX UINT64_MAX
-
-// 7.18.2.3 Limits of fastest minimum-width integer types
-#define INT_FAST8_MIN INT8_MIN
-#define INT_FAST8_MAX INT8_MAX
-#define INT_FAST16_MIN INT16_MIN
-#define INT_FAST16_MAX INT16_MAX
-#define INT_FAST32_MIN INT32_MIN
-#define INT_FAST32_MAX INT32_MAX
-#define INT_FAST64_MIN INT64_MIN
-#define INT_FAST64_MAX INT64_MAX
-#define UINT_FAST8_MAX UINT8_MAX
-#define UINT_FAST16_MAX UINT16_MAX
-#define UINT_FAST32_MAX UINT32_MAX
-#define UINT_FAST64_MAX UINT64_MAX
-
-// 7.18.2.4 Limits of integer types capable of holding object pointers
-#ifdef _WIN64 // [
-# define INTPTR_MIN INT64_MIN
-# define INTPTR_MAX INT64_MAX
-# define UINTPTR_MAX UINT64_MAX
-#else // _WIN64 ][
-# define INTPTR_MIN INT32_MIN
-# define INTPTR_MAX INT32_MAX
-# define UINTPTR_MAX UINT32_MAX
-#endif // _WIN64 ]
-
-// 7.18.2.5 Limits of greatest-width integer types
-#define INTMAX_MIN INT64_MIN
-#define INTMAX_MAX INT64_MAX
-#define UINTMAX_MAX UINT64_MAX
-
-// 7.18.3 Limits of other integer types
-
-#ifdef _WIN64 // [
-# define PTRDIFF_MIN _I64_MIN
-# define PTRDIFF_MAX _I64_MAX
-#else // _WIN64 ][
-# define PTRDIFF_MIN _I32_MIN
-# define PTRDIFF_MAX _I32_MAX
-#endif // _WIN64 ]
-
-#define SIG_ATOMIC_MIN INT_MIN
-#define SIG_ATOMIC_MAX INT_MAX
-
-#ifndef SIZE_MAX // [
-# ifdef _WIN64 // [
-# define SIZE_MAX _UI64_MAX
-# else // _WIN64 ][
-# define SIZE_MAX _UI32_MAX
-# endif // _WIN64 ]
-#endif // SIZE_MAX ]
-
-// WCHAR_MIN and WCHAR_MAX are also defined in <wchar.h>
-#ifndef WCHAR_MIN // [
-# define WCHAR_MIN 0
-#endif // WCHAR_MIN ]
-#ifndef WCHAR_MAX // [
-# define WCHAR_MAX _UI16_MAX
-#endif // WCHAR_MAX ]
-
-#define WINT_MIN 0
-#define WINT_MAX _UI16_MAX
-
-#endif // __STDC_LIMIT_MACROS ]
-
-
-// 7.18.4 Limits of other integer types
-
-#if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260
-
-// 7.18.4.1 Macros for minimum-width integer constants
-
-#define INT8_C(val) val##i8
-#define INT16_C(val) val##i16
-#define INT32_C(val) val##i32
-#define INT64_C(val) val##i64
-
-#define UINT8_C(val) val##ui8
-#define UINT16_C(val) val##ui16
-#define UINT32_C(val) val##ui32
-#define UINT64_C(val) val##ui64
-
-// 7.18.4.2 Macros for greatest-width integer constants
-#define INTMAX_C INT64_C
-#define UINTMAX_C UINT64_C
-
-#endif // __STDC_CONSTANT_MACROS ]
-
-
-#endif // _MSC_STDINT_H_ ]
View
4 lib/tinyxml/XMLUtils.h
@@ -22,6 +22,10 @@
*/
#include "../platform/util/StdString.h"
+#if defined(__MINGW32__)
+#include <string.h>
+#include <vector>
+#endif
#include "tinyxml.h"
class CDateTime;
View
2  lib/tinyxml/tinyxml.cpp
@@ -38,7 +38,7 @@ bool TiXmlBase::condenseWhiteSpace = true;
// Microsoft compiler security
FILE* TiXmlFOpen( const char* filename, const char* mode )
{
- #if defined(_MSC_VER) && (_MSC_VER >= 1400 )
+ #if !defined(__MINGW32__) && defined(_MSC_VER) && (_MSC_VER >= 1400 )
FILE* fp = 0;
errno_t err = fopen_s( &fp, filename, mode );
if ( !err && fp )
View
9 lib/tinyxml/tinyxml.h
@@ -62,11 +62,11 @@ distribution.
#define TIXML_SAFE
#ifdef TIXML_SAFE
- #if defined(_MSC_VER) && (_MSC_VER >= 1400 )
+ #if !defined(__MINGW32__) && defined(_MSC_VER) && (_MSC_VER >= 1400 )
// Microsoft visual studio, version 2005 and higher.
#define TIXML_SNPRINTF _snprintf_s
#define TIXML_SSCANF sscanf_s
- #elif defined(_MSC_VER) && (_MSC_VER >= 1200 )
+ #elif !defined(__MINGW32__) && defined(_MSC_VER) && (_MSC_VER >= 1200 )
// Microsoft visual studio, version 6 and higher.
//#pragma message( "Using _sn* functions." )
#define TIXML_SNPRINTF _snprintf
@@ -82,6 +82,11 @@ distribution.
#endif
#endif
+#ifndef _ERRNO_T_DEFINED
+#define _ERRNO_T_DEFINED
+typedef int errno_t;
+#endif
+
class TiXmlDocument;
class TiXmlElement;
class TiXmlComment;
View
2  xbmc/libXBMC_addon.h
@@ -28,7 +28,7 @@
#include <stdarg.h>
#ifdef _WIN32 // windows
-#include "dlfcn-win32.h"
+#include "../lib/platform/windows/dlfcn-win32.h"
#define ADDON_DLL "\\library.xbmc.addon\\libXBMC_addon" ADDON_HELPER_EXT
#define ADDON_HELPER_EXT ".dll"
#else
Please sign in to comment.
Something went wrong with that request. Please try again.