#ifndef HYS_MAIN_HEADER_H
#define HYS_MAIN_HEADER_H
#include <windows.h>
#include <windowsx.h>
#ifndef HYS_GLOBAL_VARIABLES
#define HYS_GLOBAL_VARIABLES
namespace hys {
const short Null = 0;
const bool True = 1;
const bool False = 0;
};
#endif // HYS_GLOBAL_VARIABLES
#endif // HYS_MAIN_HEADER_H
I want to avoid using macros as much as possible (C++ Coding Standards, by Herb Sutter & Andrei Alexandrescu), so I've decided to try to use my own constant global variables instead of NULL, TRUE, FALSE etc. and see what happens (I'm just trying different ways to do things, it's just an experiment!).
This #ifndef is supposed to check if this namespace was defined before in other files before. It is placed in my main header file.
It does work but I was wondering if this is violating any standards/rules of C++? Can this be a good use of #ifndef, #endif?