Skip to content

Commit

Permalink
Windows: reduce the size of windows.h by excluding unneeded functiona…
Browse files Browse the repository at this point in the history
…lity
  • Loading branch information
Xottab-DUTY committed Nov 25, 2023
1 parent 975fe53 commit a501d11
Showing 1 changed file with 28 additions and 6 deletions.
34 changes: 28 additions & 6 deletions src/Common/PlatformWindows.inl
Original file line number Diff line number Diff line change
@@ -1,29 +1,51 @@
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
#define IDIRECTPLAY2_OR_GREATER // ?

#ifndef _WIN32_WINNT
// Request Windows 7 functionality
#define _WIN32_WINNT _WIN32_WINNT_WIN7
#endif

#define NOGDICAPMASKS
//#define NOSYSMETRICS
#define NOVIRTUALKEYCODES
//#define NOWINMESSAGES
//#define NOWINSTYLES
#define NOSYSMETRICS
#define NOMENUS
#define NOICONS
#define NOKEYSTATES
#define NOSYSCOMMANDS
//#define NORASTEROPS
//#define NOSHOWWINDOW
#define NOATOM
#define NOCLIPBOARD
#define NOCOLOR
//#define NOCTLMGR
#define NODRAWTEXT
//#define NOGDI
#define NOKERNEL
//#define NOUSER
//#define NONLS
//#define NOMB
#define NOMEMMGR
#define NOMETAFILE
#define NOMINMAX
//#define NOMSG
#define NOOPENFILE
#define NOSCROLL
#define NOSERVICE
#define NOSOUND
//#define NOTEXTMETRIC
#define NOWH
#define NOWINOFFSETS
#define NOCOMM
#define NOKANJI
#define NOCRYPT
#define NOHELP
#define NOPROFILER
#define NODEFERWINDOWPOS
#define NOMCX

#ifndef NOMINMAX
#define NOMINMAX
#endif
#define NOIME

#define DOSWIN32
#define _WIN32_DCOM
Expand Down

1 comment on commit a501d11

@Xottab-DUTY
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has increased the build times 🥰
It's about a minute faster now, on local computers it may be even faster.

Before After
image image

Please sign in to comment.