Skip to content

Commit

Permalink
emulators/ppsspp: dogfood for-review quality back to the port
Browse files Browse the repository at this point in the history
Mainly to keep my sanity if a regression pops up.

GitHub:		hrydgard/native#271 (merged), hrydgard/ppsspp#7772


git-svn-id: svn+ssh://svn.freebsd.org/ports/head@387452 35697150-7ecd-e111-bb59-0022644237b5
  • Loading branch information
jbeich committed May 26, 2015
1 parent ebeb5b7 commit d2b7e58
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 34 deletions.
10 changes: 7 additions & 3 deletions emulators/ppsspp/files/patch-CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
--- CMakeLists.txt.orig 2015-02-26 20:05:06 UTC
+++ CMakeLists.txt
@@ -21,6 +21,8 @@ if(CMAKE_SYSTEM_PROCESSOR)
@@ -21,7 +21,11 @@ if(CMAKE_SYSTEM_PROCESSOR)
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^armv7")
set(ARMV7 ON)
endif()
- elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^x86" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "i.86")
+ elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^amd64")
+ set(X86 ON)
elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^x86" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "i.86")
+ elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^x86" OR
+ ${CMAKE_SYSTEM_PROCESSOR} MATCHES "^amd64" OR
+ ${CMAKE_SYSTEM_PROCESSOR} MATCHES "i.86")
set(X86 ON)
elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^mips")
@@ -250,7 +252,7 @@ if(NOT MSVC)
set(MIPS ON)
@@ -250,7 +254,7 @@ if(NOT MSVC)
if (NOT CMAKE_C_COMPILER_ID STREQUAL "Intel" AND NOT CMAKE_C_COMPILER_ID STREQUAL "Clang")
add_definitions(-Wno-psabi)
endif()
Expand Down
17 changes: 6 additions & 11 deletions emulators/ppsspp/files/patch-Common_StdMutex.h
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
--- Common/StdMutex.h.orig 2015-02-26 20:05:06 UTC
+++ Common/StdMutex.h
@@ -4,12 +4,10 @@
#define GCC_VER(x,y,z) ((x) * 10000 + (y) * 100 + (z))
@@ -5,7 +5,8 @@
#define GCC_VERSION GCC_VER(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__)

-// Note: __MAC_10_7 is defined on 10.7+.
// Note: __MAC_10_7 is defined on 10.7+.
-#if (GCC_VERSION >= GCC_VER(4,4,0) && __GXX_EXPERIMENTAL_CXX0X__ || defined(__APPLE__)) \
-/* GCC 4.4 provides <mutex>, except on these platforms: */ \
- && !defined(ANDROID) && !defined(__SYMBIAN32__) && !defined(MACGNUSTD)
+#if __cplusplus >= 201103L
+#if (__cplusplus >= 201103L || defined(__APPLE__) \
+ || (GCC_VERSION >= GCC_VER(4,4,0) && __GXX_EXPERIMENTAL_CXX0X__)) \
/* GCC 4.4 provides <mutex>, except on these platforms: */ \
&& !defined(ANDROID) && !defined(__SYMBIAN32__) && !defined(MACGNUSTD)
#include <mutex>
#else
+#warning "partial <mutex> implementation"

// partial <mutex> implementation for win32/pthread
#include <algorithm>
36 changes: 28 additions & 8 deletions emulators/ppsspp/files/patch-Core_HLE_sceRtc.cpp
Original file line number Diff line number Diff line change
@@ -1,38 +1,58 @@
--- Core/HLE/sceRtc.cpp.orig 2015-02-26 20:05:06 UTC
+++ Core/HLE/sceRtc.cpp
@@ -459,7 +459,7 @@ static int sceRtcConvertLocalTimeToUTC(u
@@ -459,12 +459,10 @@ static int sceRtcConvertLocalTimeToUTC(u
{
u64 srcTick = Memory::Read_U64(tickLocalPtr);
// TODO : Let the user select his timezone / daylight saving instead of taking system param ?
-#if defined(__GLIBC__) || defined(BLACKBERRY) || defined(__SYMBIAN32__)
+#if 1 // #else block uses undeclared `timezone'
+#ifndef _MSC_VER
time_t timezone = 0;
tm *time = localtime(&timezone);
srcTick -= time->tm_gmtoff*1000000ULL;
@@ -482,7 +482,7 @@ static int sceRtcConvertUtcToLocalTime(u
-#else
- srcTick -= -timezone * 1000000ULL;
#endif
Memory::Write_U64(srcTick, tickUTCPtr);
}
@@ -482,12 +480,10 @@ static int sceRtcConvertUtcToLocalTime(u
{
u64 srcTick = Memory::Read_U64(tickUTCPtr);
// TODO : Let the user select his timezone / daylight saving instead of taking system param ?
-#if defined(__GLIBC__) || defined(BLACKBERRY) || defined(__SYMBIAN32__)
+#if 1 // #else block uses undeclared `timezone'
+#ifndef _MSC_VER
time_t timezone = 0;
tm *time = localtime(&timezone);
srcTick += time->tm_gmtoff*1000000ULL;
@@ -1015,7 +1015,7 @@ static int sceRtcFormatRFC2822LocalTime(
-#else
- srcTick += -timezone * 1000000ULL;
#endif
Memory::Write_U64(srcTick, tickLocalPtr);
}
@@ -1015,12 +1011,10 @@ static int sceRtcFormatRFC2822LocalTime(
}

int tz_seconds;
-#if defined(__GLIBC__) || defined(BLACKBERRY) || defined(__SYMBIAN32__)
+#if 1 // #else block uses undeclared `timezone'
+#ifndef _MSC_VER
time_t timezone = 0;
tm *time = localtime(&timezone);
tz_seconds = time->tm_gmtoff;
@@ -1050,7 +1050,7 @@ static int sceRtcFormatRFC3339LocalTime(
-#else
- tz_seconds = -timezone;
#endif

DEBUG_LOG(SCERTC, "sceRtcFormatRFC2822LocalTime(%08x, %08x)", outPtr, srcTickPtr);
@@ -1050,12 +1044,10 @@ static int sceRtcFormatRFC3339LocalTime(
}

int tz_seconds;
-#if defined(__GLIBC__) || defined(BLACKBERRY) || defined(__SYMBIAN32__)
+#if 1 // #else block uses undeclared `timezone'
+#ifndef _MSC_VER
time_t timezone = 0;
tm *time = localtime(&timezone);
tz_seconds = time->tm_gmtoff;
-#else
- tz_seconds = -timezone;
#endif

DEBUG_LOG(SCERTC, "sceRtcFormatRFC3339LocalTime(%08x, %08x)", outPtr, srcTickPtr);
4 changes: 2 additions & 2 deletions emulators/ppsspp/files/patch-Qt_Platform_linux.pri
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

# Executable
- LIBS += -ldl -lrt
+ LIBS += $$QMAKE_LIBS_DYNLOAD
+ linux-*|hpux-*|solaris-*: LIBS += -lrt
+ LIBS += $$QMAKE_LIBS_DYNLOAD # dlopen
+ linux-*|hpux-*|solaris-*: LIBS += -lrt # clock_gettime

# Packaging
icon16.files = $$P/assets/unix-icons/hicolor/16x16/apps/ppsspp.png
2 changes: 1 addition & 1 deletion emulators/ppsspp/files/patch-Qt_Settings.pri
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
P = $$_PRO_FILE_PWD_/..
-INCLUDEPATH += $$P/ext/zlib $$P/Common
+INCLUDEPATH += $$P/Common
+contains(QT_CONFIG, no-zlib): INCLUDEPATH += $$P/ext/zlib
+win32|contains(QT_CONFIG, no-zlib): INCLUDEPATH += $$P/ext/zlib

# Work out arch name
include(Platform/ArchDetection.pri)
5 changes: 2 additions & 3 deletions emulators/ppsspp/files/patch-UI_NativeApp.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
--- UI/NativeApp.cpp.orig 2015-02-26 20:05:06 UTC
+++ UI/NativeApp.cpp
@@ -291,7 +291,8 @@ void NativeInit(int argc, const char *ar
@@ -295,7 +295,7 @@ void NativeInit(int argc, const char *ar
#elif defined(BLACKBERRY) || defined(IOS)
// Packed assets are included in app
VFSRegister("", new DirectoryAssetReader(external_directory));
-#elif defined(__APPLE__) || (defined(__linux__) && !defined(ANDROID))
+#elif defined(__APPLE__) || (defined(__linux__) && !defined(ANDROID)) || \
+ defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
+#elif !defined(MOBILE_DEVICE) && !defined(_WIN32)
VFSRegister("", new DirectoryAssetReader((File::GetExeDirectory() + "assets/").c_str()));
VFSRegister("", new DirectoryAssetReader((File::GetExeDirectory()).c_str()));
VFSRegister("", new DirectoryAssetReader("/usr/share/ppsspp/assets/"));
8 changes: 7 additions & 1 deletion emulators/ppsspp/files/patch-native_ext_cityhash_city.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- native/ext/cityhash/city.cpp.orig 2015-02-23 23:22:58 UTC
+++ native/ext/cityhash/city.cpp
@@ -68,7 +68,7 @@ static uint32 UNALIGNED_LOAD32(const cha
@@ -68,12 +68,12 @@ static uint32 UNALIGNED_LOAD32(const cha
#define bswap_32(x) BSWAP_32(x)
#define bswap_64(x) BSWAP_64(x)

Expand All @@ -9,3 +9,9 @@
#include <sys/endian.h>
#define bswap_32(x) bswap32(x)
#define bswap_64(x) bswap64(x)

-#elif defined(__OpenBSD__)
+#elif defined(__Bitrig__) || defined(__OpenBSD__)
#include <sys/types.h>
#define bswap_32(x) swap32(x)
#define bswap_64(x) swap64(x)
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#pragma warning (disable:4244)
#include <malloc.h>
-#elif !defined(__SYMBIAN32__)
+#elif !defined(__SYMBIAN32__) && !defined(__DragonFly__) && \
+#elif !defined(__SYMBIAN32__) && !defined(__Bitrig__) && !defined(__DragonFly__) && \
+ !defined(__FreeBSD__) && !defined(__NetBSD__) && !defined(__OpenBSD__)
#include <alloca.h>
#endif
Expand Down
2 changes: 1 addition & 1 deletion emulators/ppsspp/files/patch-native_file_file__util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "util/text/utf8.h"

-#if defined(__FreeBSD__) || defined(__APPLE__)
+#if !defined(__linux__) && !defined(__SYMBIAN32__)
+#if !defined(__linux__) && !defined(_WIN32) && !defined(__QNX__)
#define stat64 stat
#endif

6 changes: 3 additions & 3 deletions emulators/ppsspp/files/patch-native_net_http__server.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
--- native/net/http_server.cpp.orig 2015-02-23 23:22:58 UTC
+++ native/net/http_server.cpp
@@ -12,6 +12,7 @@
@@ -11,6 +11,7 @@
#include <sys/socket.h> /* socket definitions */
#include <sys/types.h> /* socket types */
#include <sys/wait.h> /* for waitpid() */
#include <arpa/inet.h> /* inet (3) funtions */
+#include <netinet/in.h> /* struct sockaddr_in */
#include <arpa/inet.h> /* inet (3) funtions */
#include <unistd.h> /* misc. UNIX functions */

#endif

0 comments on commit d2b7e58

Please sign in to comment.