the preprocessor command #warning is not standard.

use #pragma message WARN("xD") to make it work on gcc and msvc
This commit is contained in:
Rasmus Karlsson
2017-01-05 16:42:26 +01:00
parent e68f885dff
commit 7262c11458
5 changed files with 23 additions and 5 deletions
+15
View File
@@ -0,0 +1,15 @@
#ifndef COMMON_H
#define COMMON_H
#define STRINGISE_IMPL(x) #x
#define STRINGISE(x) STRINGISE_IMPL(x)
// Use: #pragma message WARN("My message")
#if _MSC_VER
# define FILE_LINE_LINK __FILE__ "(" STRINGISE(__LINE__) ") : "
# define WARN(exp) (FILE_LINE_LINK "WARNING: " exp)
#else//__GNUC__ - may need other defines for different compilers
# define WARN(exp) ("WARNING: " exp)
#endif
#endif // COMMON_H