Skip to content

Commit e2fb6e6

Browse files
authored
Merge pull request #722 from paulsapps/main
Allow building psyq-obj-parser.cc on its own more easily
2 parents da29324 + b65217a commit e2fb6e6

File tree

8 files changed

+65
-9
lines changed

8 files changed

+65
-9
lines changed

src/core/psxemulator.h

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,7 @@
4646

4747
#ifndef MAXPATHLEN
4848
#ifdef _WIN32
49-
#ifndef WIN32_LEAN_AND_MEAN
50-
#define WIN32_LEAN_AND_MEAN
51-
#endif
52-
#ifndef NOMINMAX
53-
#define NOMINMAX
54-
#endif
55-
#include <windows.h>
49+
#include "support/windowswrapper.h"
5650
#endif
5751
#ifdef MAX_PATH
5852
#define MAXPATHLEN MAX_PATH

src/gui/resources-unix.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
#ifndef _WIN32
2121

22+
#include "core/system.h"
2223
#include "gui/resources.h"
2324
#include "support/file.h"
2425

src/support/file.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#include "support/file.h"
2121

2222
#include <algorithm>
23+
#include <assert.h>
24+
#include "support/windowswrapper.h"
2325

2426
const uint8_t PCSX::File::m_internalBuffer = 0;
2527

src/support/file.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424

2525
#include <filesystem>
2626

27-
#include "core/psxemulator.h"
2827
#include "support/slice.h"
28+
#include "support/ssize_t.h"
2929

3030
namespace PCSX {
3131

src/support/ssize_t.h

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/***************************************************************************
2+
* Copyright (C) 2022 PCSX-Redux authors *
3+
* *
4+
* This program is free software; you can redistribute it and/or modify *
5+
* it under the terms of the GNU General Public License as published by *
6+
* the Free Software Foundation; either version 2 of the License, or *
7+
* (at your option) any later version. *
8+
* *
9+
* This program is distributed in the hope that it will be useful, *
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12+
* GNU General Public License for more details. *
13+
* *
14+
* You should have received a copy of the GNU General Public License *
15+
* along with this program; if not, write to the *
16+
* Free Software Foundation, Inc., *
17+
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
18+
***************************************************************************/
19+
20+
#pragma once
21+
22+
23+
#ifdef _WIN32
24+
typedef intptr_t ssize_t;
25+
#endif

src/support/windowswrapper.h

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/***************************************************************************
2+
* Copyright (C) 2022 PCSX-Redux authors *
3+
* *
4+
* This program is free software; you can redistribute it and/or modify *
5+
* it under the terms of the GNU General Public License as published by *
6+
* the Free Software Foundation; either version 2 of the License, or *
7+
* (at your option) any later version. *
8+
* *
9+
* This program is distributed in the hope that it will be useful, *
10+
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
11+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12+
* GNU General Public License for more details. *
13+
* *
14+
* You should have received a copy of the GNU General Public License *
15+
* along with this program; if not, write to the *
16+
* Free Software Foundation, Inc., *
17+
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
18+
***************************************************************************/
19+
20+
#pragma once
21+
22+
#ifdef _WIN32
23+
// Chop down the size of the windows.h to reduce pollution and build times
24+
#ifndef WIN32_LEAN_AND_MEAN
25+
#define WIN32_LEAN_AND_MEAN
26+
#endif
27+
// Don't #define min or max as it will break std::min/max
28+
#ifndef NOMINMAX
29+
#define NOMINMAX
30+
#endif
31+
#include <windows.h>
32+
#endif

tools/ps1-packer/ps1-packer.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
#include <memory.h>
2121
#include <stdint.h>
22-
22+
#include <assert.h>
2323
#include <vector>
2424

2525
#include "flags.h"

tools/psyq-obj-parser/psyq-obj-parser.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@
1919

2020
#include <list>
2121
#include <map>
22+
#include <assert.h>
2223

2324
#include "elfio/elfio.hpp"
2425
#include "flags.h"
2526
#include "support/djbhash.h"
2627
#include "support/file.h"
2728
#include "support/hashtable.h"
2829
#include "support/slice.h"
30+
#include "support/windowswrapper.h"
2931

3032
#define vprint(...) \
3133
if (verbose) fmt::print(__VA_ARGS__)

0 commit comments

Comments
 (0)