Skip to content

Instantly share code, notes, and snippets.

@Vladimir-Novick
Last active August 2, 2021 10:31
Show Gist options
  • Save Vladimir-Novick/105d695374aa049cf4fc328122dbc32e to your computer and use it in GitHub Desktop.
Save Vladimir-Novick/105d695374aa049cf4fc328122dbc32e to your computer and use it in GitHub Desktop.
global compilation configuring windows sdk headers for Visual Studio 2019 ISO C++ 17 ( using byte as unsigned char )
#pragma once
// global compilation flag configuring windows sdk headers
// preventing inclusion of min and max macros clashing with <limits>
#define NOMINMAX 1
// override byte to prevent clashes with <cstddef>
typedef unsigned char byte;
// Define min max macros required by GDI+ headers.
#ifndef max
#define max(a,b) (((a) > (b)) ? (a) : (b))
#endif
#ifndef min
#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif
#include <afxwin.h> // MFC core and standard components - gdi plus requires Windows.h
#include <gdiplus.h>
// Undefine min max macros so they won't collide with <limits> header content.
#undef min
#undef max
// Undefine byte macros so it won't collide with <cstddef> header content.
#undef byte
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment