1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-09 16:35:12 +00:00
QB64-PE/internal/c/libqb/include/libqb-common.h
Matthew Kilgore 30c0634d20 Fix High-DPI awareness on Windows
We started defining `_WIN32_WINNT` a little while ago to express that we
require Windows Vista or above for support. This enables us to access
some Windows Vista-only APIs. The fact that `WINVER` also needs to be
defined was missed, and it seems that defining one means the other no
longer gets defined automatically as it did before. Thus we're simplying
now also defining `WINVER` the same as `_WIN32_WINNT`.

This fixes High-DPI awareness and a few other things that were gated
behind WINVER checks.
2022-08-28 21:44:07 -04:00

56 lines
1.6 KiB
C

#ifndef INCLUDE_LIBQB_LIBQB_COMMON_H
#define INCLUDE_LIBQB_LIBQB_COMMON_H
// Should be included at the top of every .cpp file
/* Provide some OS/compiler macros.
* QB64_WINDOWS: Is this a Windows system?
* QB64_LINUX: Is this a Linux system?
* QB64_MACOSX: Is this MacOSX, or MacOS or whatever Apple calls it now?
* QB64_UNIX: Is this a Unix-flavoured system?
*
* QB64_BACKSLASH_FILESYSTEM: Does this system use \ for file paths (as opposed to /)?
* QB64_MICROSOFT: Are we compiling with Visual Studio?
* QB64_GCC: Are we compiling with gcc?
* QB64_MINGW: Are we compiling with MinGW, specifically? (Set in addition to QB64_GCC)
*
* QB64_32: A 32bit system (the default)
* QB64_64: A 64bit system (assumes all Macs are 64 bit)
*/
#ifdef WIN32
# define QB64_WINDOWS
// This supports Windows Vista and up
# define _WIN32_WINNT 0x0600
# define WINVER 0x0600
# define QB64_BACKSLASH_FILESYSTEM
# ifdef _MSC_VER
// Do we even support non-mingw compilers on Windows?
# define QB64_MICROSOFT
# else
# define QB64_GCC
# define QB64_MINGW
# endif
#elif defined(__APPLE__)
# define QB64_MACOSX
# define QB64_UNIX
# define QB64_GCC
#elif defined(__linux__)
# define QB64_LINUX
# define QB64_UNIX
# define QB64_GCC
#else
# error "Unknown system; refusing to build. Edit os.h if needed"
#endif
#if defined(_WIN64) || defined(__x86_64__) || defined(__ppc64__) || defined(QB64_MACOSX) || defined(__aarch64__)
# define QB64_64
#else
# define QB64_32
#endif
#if !defined(i386) && !defined(__x86_64__)
# define QB64_NOT_X86
#endif
#endif