refactor: start to refactor project
This commit is contained in:
0
src/yycc/windows/com.cpp
Normal file
0
src/yycc/windows/com.cpp
Normal file
0
src/yycc/windows/com.hpp
Normal file
0
src/yycc/windows/com.hpp
Normal file
0
src/yycc/windows/dialog.cpp
Normal file
0
src/yycc/windows/dialog.cpp
Normal file
0
src/yycc/windows/dialog.hpp
Normal file
0
src/yycc/windows/dialog.hpp
Normal file
19
src/yycc/windows/import_guard_head.hpp
Normal file
19
src/yycc/windows/import_guard_head.hpp
Normal file
@ -0,0 +1,19 @@
|
||||
// It is by design that no pragma once or #if to prevent deplicated including.
|
||||
// Because this header is the part of wrapper, not a real header.
|
||||
// #pragma once
|
||||
|
||||
#include "../macro/os_detector.hpp"
|
||||
|
||||
#if YYCC_OS == YYCC_OS_WINDOWS
|
||||
|
||||
// Define 2 macros to disallow Windows generate MIN and MAX macros
|
||||
// which cause std::min and std::max can not function as normal.
|
||||
#if !defined(WIN32_LEAN_AND_MEAN)
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
|
||||
#if !defined(NOMINMAX)
|
||||
#define NOMINMAX
|
||||
#endif
|
||||
|
||||
#endif
|
23
src/yycc/windows/import_guard_tail.hpp
Normal file
23
src/yycc/windows/import_guard_tail.hpp
Normal file
@ -0,0 +1,23 @@
|
||||
// It is by design that no pragma once or #if to prevent deplicated including.
|
||||
// Because this header is the part of wrapper, not a real header.
|
||||
// #pragma once
|
||||
|
||||
#include "../macro/os_detector.hpp"
|
||||
|
||||
#if YYCC_OS == YYCC_OS_WINDOWS
|
||||
|
||||
// Windows also will generate following macros
|
||||
// which may cause the function sign is different in Windows and other platforms.
|
||||
// So we simply remove them.
|
||||
// Because #undef will not throw error if there are no matched macro,
|
||||
// so we simply #undef them directly.
|
||||
#undef GetObject
|
||||
#undef GetClassName
|
||||
#undef LoadImage
|
||||
#undef GetTempPath
|
||||
#undef GetModuleFileName
|
||||
#undef CopyFile
|
||||
#undef MoveFile
|
||||
#undef DeleteFile
|
||||
|
||||
#endif
|
16
src/yycc/windows/unsafe_suppressor.hpp
Normal file
16
src/yycc/windows/unsafe_suppressor.hpp
Normal file
@ -0,0 +1,16 @@
|
||||
#pragma once
|
||||
#include "../macro/os_detector.hpp"
|
||||
|
||||
// If we are in Windows,
|
||||
// we need add 2 macros to disable Windows shitty warnings and errors of
|
||||
// depracted functions and not secure functions.
|
||||
#if YYCC_OS == YYCC_OS_WINDOWS
|
||||
|
||||
#if !defined(_CRT_SECURE_NO_WARNINGS)
|
||||
#define _CRT_SECURE_NO_WARNINGS
|
||||
#endif
|
||||
#if !defined(_CRT_NONSTDC_NO_DEPRECATE)
|
||||
#define _CRT_NONSTDC_NO_DEPRECATE
|
||||
#endif
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user