Skip to content

Commit

Permalink
[win32] Moved all C and C++ includes to stdafx.h to take advantage of…
Browse files Browse the repository at this point in the history
… precompiled headers.

Need to move common librpbase etc. headers next.
  • Loading branch information
GerbilSoft committed Jan 13, 2020
1 parent 70d2cf8 commit fdb4e6d
Show file tree
Hide file tree
Showing 26 changed files with 65 additions and 124 deletions.
4 changes: 1 addition & 3 deletions src/win32/CreateThumbnail.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ using namespace LibRpTexture;
// libwin32common
#include "libwin32common/WinUI.hpp"

// C++ includes.
#include <memory>
#include <string>
// C++ STL classes.
using std::string;
using std::unique_ptr;

Expand Down
6 changes: 1 addition & 5 deletions src/win32/DllMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,7 @@ using LibRpTexture::rp_image;
#include "libromdata/RomDataFactory.hpp"
using LibRomData::RomDataFactory;

// C++ includes.
#include <memory>
#include <string>
#include <vector>
#include <list>
// C++ STL classes.
using std::list;
using std::string;
using std::unique_ptr;
Expand Down
8 changes: 1 addition & 7 deletions src/win32/RP_ExtractIcon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,7 @@ using LibRpTexture::rp_image;
#include "libromdata/RomDataFactory.hpp"
using LibRomData::RomDataFactory;

// C includes. (C++ namespace)
#include <cassert>
#include <cstdio>
#include <cstring>

// C++ includes.
#include <string>
// C++ STL classes.
using std::wstring;

// CLSID
Expand Down
4 changes: 1 addition & 3 deletions src/win32/RP_ExtractIcon_Fallback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@ using namespace LibRpBase;
#include "libwin32common/sdk/GUID_fn.h"
using LibWin32Common::RegKey;

// C++ includes.
#include <memory>
#include <string>
// C++ STL classes.
using std::unique_ptr;
using std::tstring;

Expand Down
3 changes: 1 addition & 2 deletions src/win32/RP_ExtractIcon_Register.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
#include "libwin32common/RegKey.hpp"
using LibWin32Common::RegKey;

// C++ includes.
#include <string>
// C++ STL classes.
using std::tstring;

#define CLSID_RP_ExtractIcon_String TEXT("{E51BC107-E491-4B29-A6A3-2A4309259802}")
Expand Down
8 changes: 1 addition & 7 deletions src/win32/RP_ExtractImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,7 @@ using LibRpTexture::rp_image;
#include "libromdata/RomDataFactory.hpp"
using LibRomData::RomDataFactory;

// C includes. (C++ namespace)
#include <cassert>
#include <cstdio>
#include <cstring>

// C++ includes.
#include <string>
// C++ STL classes.
using std::tstring;

// CLSID
Expand Down
3 changes: 1 addition & 2 deletions src/win32/RP_ExtractImage_Fallback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ using namespace LibRpBase;
#include "libwin32common/sdk/GUID_fn.h"
using LibWin32Common::RegKey;

// C++ includes.
#include <string>
// C++ STL classes.
using std::tstring;

// COM smart pointer typedefs.
Expand Down
3 changes: 1 addition & 2 deletions src/win32/RP_ExtractImage_Register.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
#include "libwin32common/RegKey.hpp"
using LibWin32Common::RegKey;

// C++ includes.
#include <string>
// C++ STL classes.
using std::tstring;

#define IID_IExtractImage_String TEXT("{BB2E617C-0920-11D1-9A0B-00C04FC2D6C1}")
Expand Down
9 changes: 1 addition & 8 deletions src/win32/RP_PropertyStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,7 @@ using LibRomData::RomDataFactory;
// RpFile_IStream
#include "RpFile_IStream.hpp"

// C includes. (C++ namespace)
#include <cassert>
#include <cstdio>
#include <cstring>

// C++ includes.
#include <algorithm>
#include <string>
// C++ STL classes.
using std::wstring;

// CLSID
Expand Down
3 changes: 1 addition & 2 deletions src/win32/RP_PropertyStore_Register.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
#include "libwin32common/RegKey.hpp"
using LibWin32Common::RegKey;

// C++ includes.
#include <string>
// C++ STL classes.
using std::tstring;

#define CLSID_RP_PropertyStore_String TEXT("{4A1E3510-50BD-4B03-A801-E4C954F43B96}")
Expand Down
8 changes: 1 addition & 7 deletions src/win32/RP_ShellIconOverlayIdentifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,7 @@ using namespace LibRpBase;
#include "libromdata/RomDataFactory.hpp"
using LibRomData::RomDataFactory;

// C includes. (C++ namespace)
#include <cassert>
#include <cstdio>
#include <cstring>

// C++ includes.
#include <string>
// C++ STL classes.
using std::string;

// CLSID
Expand Down
3 changes: 0 additions & 3 deletions src/win32/RP_ShellIconOverlayIdentifier_p.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
// CLSID
extern const CLSID CLSID_RP_ShellIconOverlayIdentifier;

// C++ includes.
#include <vector>

class RP_ShellIconOverlayIdentifier_Private
{
public:
Expand Down
14 changes: 1 addition & 13 deletions src/win32/RP_ShellPropSheetExt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,7 @@ using LibRpTexture::rp_image;
#include "libromdata/RomDataFactory.hpp"
using LibRomData::RomDataFactory;

// C includes. (C++ namespace)
#include <cassert>
#include <cstring>

// C++ includes.
#include <algorithm>
#include <array>
#include <memory>
#include <numeric>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
// C++ STL classes.
using std::array;
using std::unique_ptr;
using std::unordered_map;
Expand Down
3 changes: 1 addition & 2 deletions src/win32/RP_ShellPropSheetExt_Register.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@
#include "libwin32common/RegKey.hpp"
using LibWin32Common::RegKey;

// C++ includes.
#include <string>
// C++ STL classes.
using std::tstring;

#define CLSID_RP_ShellPropSheetExt_String TEXT("{2443C158-DF7C-4352-B435-BC9F885FFD52}")
Expand Down
8 changes: 1 addition & 7 deletions src/win32/RP_ThumbnailProvider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,7 @@ using LibRpTexture::rp_image;
// RpFile_IStream
#include "RpFile_IStream.hpp"

// C includes. (C++ namespace)
#include <cassert>
#include <cstdio>
#include <cstring>

// C++ includes.
#include <string>
// C++ STL classes.
using std::wstring;

// CLSID
Expand Down
3 changes: 1 addition & 2 deletions src/win32/RP_ThumbnailProvider_Fallback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ using namespace LibRpBase;
#include "libwin32common/sdk/GUID_fn.h"
using LibWin32Common::RegKey;

// C++ includes.
#include <string>
// C++ STL classes.
using std::string;
using std::wstring;

Expand Down
3 changes: 1 addition & 2 deletions src/win32/RP_ThumbnailProvider_Register.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
#include "libwin32common/RegKey.hpp"
using LibWin32Common::RegKey;

// C++ includes.
#include <string>
// C++ STL classes.
using std::tstring;

#define IID_IThumbnailProvider_String TEXT("{E357FCCD-A995-4576-B01F-234630154E96}")
Expand Down
4 changes: 1 addition & 3 deletions src/win32/RpFile_IStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
#include "librpbase/file/IRpFile.hpp"
using namespace LibRpBase;

// C++ includes.
#include <memory>
#include <string>
// C++ STL classes.
using std::string;
using std::unique_ptr;

Expand Down
8 changes: 1 addition & 7 deletions src/win32/RpImageWin32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,7 @@
using LibRpTexture::rp_image;
using LibRpTexture::RpGdiplusBackend;

// C includes. (C++ namespace)
#include <cassert>
#include <cstring>

// C++ includes.
#include <memory>
#include <vector>
// C++ STL classes.
using std::unique_ptr;
using std::vector;

Expand Down
7 changes: 1 addition & 6 deletions src/win32/config/AboutTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,7 @@ using namespace LibRpBase;
// Extracted from imageres.dll or shell32.dll.
#include "PropSheetIcon.hpp"

// C includes. (C++ namespace)
#include <cassert>
#include <cstring>

// C++ includes.
#include <string>
// C++ STL classes.
using std::string;
using std::wstring;
using std::u16string;
Expand Down
8 changes: 1 addition & 7 deletions src/win32/config/CacheTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,7 @@ _COM_SMARTPTR_TYPEDEF(IEmptyVolumeCache, IID_IEmptyVolumeCache);
__CRT_UUID_DECL(IEmptyVolumeCache, __MSABI_LONG(0x8fce5227), 0x04da, 0x11d1, 0xa0,0x04, 0x00, 0x80, 0x5f, 0x8a, 0xbe, 0x06)
#endif

// C includes. (C++ namespace)
#include <cassert>

// C++ includes.
#include <string>
#include <utility>
#include <vector>
// C++ STL classes.
using std::pair;
using std::string;
using std::vector;
Expand Down
9 changes: 1 addition & 8 deletions src/win32/config/ConfigDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,7 @@ using namespace LibRpBase;
// Extracted from imageres.dll or shell32.dll.
#include "PropSheetIcon.hpp"

// C includes.
#include <stdlib.h>

// C includes. (C++ namespace)
#include <cassert>

// C++ includes.
#include <string>
// C++ STL classes.
using std::tstring;

#include "libi18n/config.libi18n.h"
Expand Down
6 changes: 1 addition & 5 deletions src/win32/config/ImageTypesTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ using namespace LibRpBase;
// libi18n
#include "libi18n/i18n.h"

// C includes. (C++ namespace)
#include <cassert>

// C++ includes.
#include <string>
// C++ STL classes.
using std::tstring;

// TImageTypesConfig is a templated class,
Expand Down
7 changes: 1 addition & 6 deletions src/win32/config/KeyManagerTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,7 @@ using namespace LibRpBase;
#include "libromdata/crypto/N3DSVerifyKeys.hpp"
using namespace LibRomData;

// C includes. (C++ namespace)
#include <cassert>

// C++ includes.
#include <algorithm>
#include <string>
// C++ STL classes.
using std::string;
using std::wstring;

Expand Down
6 changes: 1 addition & 5 deletions src/win32/config/OptionsTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ using LibRpBase::Config;
// libi18n
#include "libi18n/i18n.h"

// C includes. (C++ namespace)
#include <cassert>

// C++ includes.
#include <string>
// C++ STL classes.
using std::tstring;

class OptionsTabPrivate
Expand Down
41 changes: 41 additions & 0 deletions src/win32/stdafx.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,45 @@
// Common Controls COM declarations.
#include <commoncontrols.h>

/** C/C++ headers **/

#ifdef __cplusplus
/** C++ **/

// C includes. (C++ namespace)
#include <cassert>
#include <cstdio>
#include <cstring>
#include <stdlib.h>
#include <stdint.h>
/*
#include <cerrno>
#include <cstddef>
#include <cstdio>
#include <ctime>
*/

// C++ includes.
#include <algorithm>
#include <array>
#include <list>
#include <memory>
#include <numeric>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

#else /* !__cplusplus */
/** C **/

// C includes.
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#endif /* __cplusplus */

#endif /* __ROMPROPERTIES_WIN32_STDAFX_H__ */

0 comments on commit fdb4e6d

Please sign in to comment.