Skip to content

Commit

Permalink
Merge pull request #19889 from oltolm/mingw32
Browse files Browse the repository at this point in the history
remove more `__MINGW32__` ifdefs
  • Loading branch information
hrydgard authored Jan 19, 2025
2 parents fd36a79 + f11674b commit e2c9376
Show file tree
Hide file tree
Showing 18 changed files with 17 additions and 127 deletions.
3 changes: 0 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ charset = utf-8-bom
# This file may need to force a BOM so compilers treat as utf-8.
charset = utf-8-bom

[Windows/{aboutbox.rc,version.rc}]
charset = utf-8

[ext/at3_standalone/**.{cpp,h}]
indent_style = space
indent_size = 4
Expand Down
7 changes: 0 additions & 7 deletions Common/File/DirListing.cpp
Original file line number Diff line number Diff line change
@@ -1,12 +1,5 @@
#include "ppsspp_config.h"

#ifdef __MINGW32__
#include <unistd.h>
#ifndef _POSIX_THREAD_SAFE_FUNCTIONS
#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L
#endif
#endif

#if PPSSPP_PLATFORM(WINDOWS)
#define WIN32_LEAN_AND_MEAN
#include "Common/CommonWindows.h"
Expand Down
2 changes: 1 addition & 1 deletion Common/File/FileUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

// Some functions here support Android content URIs. These are marked as such.

#ifdef _MSC_VER
#ifdef _WIN32
inline struct tm* localtime_r(const time_t *clock, struct tm *result) {
if (localtime_s(result, clock) == 0)
return result;
Expand Down
9 changes: 1 addition & 8 deletions Core/Dialog/PSPSaveDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,8 @@
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.

#ifdef __MINGW32__
#include <unistd.h>
#ifndef _POSIX_THREAD_SAFE_FUNCTIONS
#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L
#endif
#endif


#include <algorithm>
#include <ctime>
#include <thread>

#include "Common/Data/Encoding/Utf8.h"
Expand Down
9 changes: 1 addition & 8 deletions Core/FileSystems/DirectoryFileSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,6 @@

#include "ppsspp_config.h"

#ifdef __MINGW32__
#include <unistd.h>
#ifndef _POSIX_THREAD_SAFE_FUNCTIONS
#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L
#endif
#endif

#include <algorithm>
#include <ctime>
#include <limits>
Expand Down Expand Up @@ -741,7 +734,7 @@ static void tmFromFiletime(tm &dest, const FILETIME &src) {
u64 from_1970_us = from_1601_us - FILETIME_FROM_UNIX_EPOCH_US;

time_t t = (time_t) (from_1970_us / 1000000UL);
localtime_r(&t, &dest);
localtime_s(&dest, &t);
}
#endif

Expand Down
8 changes: 1 addition & 7 deletions Core/FileSystems/VirtualDiscFileSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.

#include "ppsspp_config.h"
#ifdef __MINGW32__
#include <unistd.h>
#ifndef _POSIX_THREAD_SAFE_FUNCTIONS
#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L
#endif
#endif
#include <ctime>

#include "Common/File/FileUtil.h"
Expand Down Expand Up @@ -656,7 +650,7 @@ static void tmFromFiletime(tm &dest, const FILETIME &src)
u64 from_1970_us = from_1601_us - FILETIME_FROM_UNIX_EPOCH_US;

time_t t = (time_t) (from_1970_us / 1000000UL);
localtime_r(&t, &dest);
localtime_s(&dest, &t);
}
#endif

Expand Down
3 changes: 0 additions & 3 deletions Core/HLE/sceSircs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.

#ifdef __MINGW32__
#include <unistd.h>
#endif
#include <ctime>

#include "Common/System/System.h"
Expand Down
7 changes: 0 additions & 7 deletions Core/Replay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,6 @@
// Official git repository and contact information can be found at
// https://github.com/hrydgard/ppsspp and http://www.ppsspp.org/.

#ifdef __MINGW32__
#include <unistd.h>
#ifndef _POSIX_THREAD_SAFE_FUNCTIONS
#define _POSIX_THREAD_SAFE_FUNCTIONS 200112L
#endif
#endif

#include <cstring>
#include <ctime>
#include <vector>
Expand Down
2 changes: 0 additions & 2 deletions Windows/PPSSPP.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1703,14 +1703,12 @@
<None Include="zipup.cmd" />
</ItemGroup>
<ItemGroup>
<None Include="aboutbox.rc" />
<ResourceCompile Include="ppsspp.rc">
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(EXTERNAL_RC_DEFINITIONS);_VC80_UPGRADE=0x0710;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(EXTERNAL_RC_DEFINITIONS);_VC80_UPGRADE=0x0710;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">$(EXTERNAL_RC_DEFINITIONS);_VC80_UPGRADE=0x0710;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">$(EXTERNAL_RC_DEFINITIONS);_VC80_UPGRADE=0x0710;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ResourceCompile>
<None Include="version.rc" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Common\Common.vcxproj">
Expand Down
20 changes: 0 additions & 20 deletions Windows/aboutbox.rc

This file was deleted.

20 changes: 7 additions & 13 deletions Windows/ppsspp.rc
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ END
// Version
//

// no utf-16 support when using mingw's resource compiler
#ifdef __MINGW32__
#pragma code_page(65001)

// win-version.h is generated by git-version-gen.cmd.
#include "win-version.h"

Expand All @@ -126,11 +126,11 @@ BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments", "PPSSPP PSP emulator"
VALUE "CompanyName", "Henrik Rydg\xE5rd"
VALUE "CompanyName", "Henrik Rydgård"
VALUE "FileDescription", "PPSSPP"
VALUE "FileVersion", PPSSPP_WIN_VERSION_STRING
VALUE "InternalName", "PPSSPPEmu"
VALUE "LegalCopyright", "Copyright \xA9 2006-2021 by Henrik Rydg\xE5rd"
VALUE "LegalCopyright", "Copyright © 2006-2021 by Henrik Rydgård"
VALUE "LegalTrademarks", "All product names are trademarks of their respective owners."
VALUE "OriginalFilename", "PPSSPP.exe"
VALUE "ProductName", "PPSSPP"
Expand All @@ -142,9 +142,6 @@ BEGIN
VALUE "Translation", 0x409, 1200
END
END
#else
#include "version.rc"
#endif

#endif // Neutral (Default) resources
/////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -274,8 +271,8 @@ BEGIN
CONTROL "",IDC_GEDBG_MATRICES,"SysListView32",LVS_ALIGNLEFT | LVS_SHOWSELALWAYS | LVS_REPORT | WS_BORDER | WS_TABSTOP,7,7,217,86
END

// no utf-16 support when using mingw's resource compiler
#ifdef __MINGW32__
#pragma code_page(65001)

IDD_ABOUTBOX DIALOGEX 0, 0, 301, 163
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "About"
Expand All @@ -284,17 +281,14 @@ BEGIN
DEFPUSHBUTTON "OK",IDOK,243,140,50,14
ICON IDI_PPSSPP,IDC_STATIC,10,9,21,20
LTEXT "PPSSPP",IDC_VERSION,40,8,127,9
LTEXT "Copyright \xA9 by Henrik Rydg\xE5rd the PPSSPP project 2012-",IDC_STATIC,40,33,253,8
LTEXT "Copyright © by Henrik Rydgård the PPSSPP project 2012-",IDC_STATIC,40,33,253,8
LTEXT "All trademarks are property of their respective owners.\nThe emulator is for educational and development purposes only and it may not be used to play games you do not legally own.",IDC_STATIC,40,102,253,24
LTEXT "PSP emulator and debugger",IDC_STATIC,40,19,253,8
LTEXT "CISO decompression code by BOOSTER",IDC_STATIC,48,73,240,8
LTEXT "PSPSDK by #pspdev (freenode)",IDC_STATIC,48,62,240,8
LTEXT "zlib by Jean-loup Gailly (compression) and Mark Adler (decompression)",IDC_STATIC,48,85,240,8
LTEXT "Additional credits:",IDC_STATIC,40,49,253,8
END
#else
#include "aboutbox.rc"
#endif

IDD_MEMORY DIALOGEX 0, 0, 700, 310
STYLE DS_SETFONT | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
Expand Down
41 changes: 0 additions & 41 deletions Windows/version.rc

This file was deleted.

2 changes: 1 addition & 1 deletion ext/SPIRV-Cross-build/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.10)
project(SPIRV-Cross)
enable_testing()

Expand Down
2 changes: 1 addition & 1 deletion ext/discord-rpc-build/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 3.2.0)
cmake_minimum_required (VERSION 3.10.0)
project (DiscordRPC)

set(SRC_DIR ../discord-rpc/src)
Expand Down
2 changes: 1 addition & 1 deletion ext/libchdr-build/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 3.2.0)
cmake_minimum_required (VERSION 3.10.0)
project (chdr)

set(LZMA_DIR ../libchdr/deps/lzma-22.01/src)
Expand Down
2 changes: 1 addition & 1 deletion ext/lua-build/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 3.2.0)
cmake_minimum_required (VERSION 3.10.0)
project (lua)

set(SRC_DIR ../lua)
Expand Down
2 changes: 1 addition & 1 deletion ext/rcheevos-build/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required (VERSION 3.2.0)
cmake_minimum_required (VERSION 3.10.0)
project (RCheevos)

set(SRC_DIR ../rcheevos/src)
Expand Down
3 changes: 1 addition & 2 deletions ext/zstd-build/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
cmake_minimum_required (VERSION 3.2.0)
cmake_minimum_required (VERSION 3.10.0)
project (libzstd_static)

set(SRC_DIR ../zstd/lib)
message(${SRC_DIR})

set(ALL_SOURCE_FILES
${SRC_DIR}/common/debug.c
Expand Down

0 comments on commit e2c9376

Please sign in to comment.