From 9116bb7fcf4661939c84774ae54c048370673a3d Mon Sep 17 00:00:00 2001
From: Recolic Keghart <root@recolic.net>
Date: Thu, 5 Mar 2020 00:37:00 -0800
Subject: [PATCH] optimize some feature for C

---
 c-with-class.h |  1 +
 macro.hpp      |  1 +
 sys/os.hpp     | 21 +++++++++++----------
 3 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/c-with-class.h b/c-with-class.h
index 4a45bc5..776fb69 100644
--- a/c-with-class.h
+++ b/c-with-class.h
@@ -1,3 +1,4 @@
+// This header is compatible for ONLY C, requires C99 (double slash comment).
 #ifndef RLIB_CWITHCLASS_H_
 #define RLIB_CWITHCLASS_H_
 
diff --git a/macro.hpp b/macro.hpp
index c411790..2819a3a 100644
--- a/macro.hpp
+++ b/macro.hpp
@@ -1,3 +1,4 @@
+// This header is compatible for both C and C++, requires C99 (double slash comment).
 #ifndef R_MACRO_HPP
 #define R_MACRO_HPP
 
diff --git a/sys/os.hpp b/sys/os.hpp
index 1843522..5039b15 100644
--- a/sys/os.hpp
+++ b/sys/os.hpp
@@ -1,3 +1,4 @@
+// This header is compatible for both C and C++, requires C99 (double slash comment).
 #ifndef R_OS_HPP
 #define R_OS_HPP
 
@@ -26,7 +27,7 @@
 #endif
 #endif
 
-#define RLIB_OS_ID_MAGIC 980427
+#define RLIB_OS_ID_MAGIC 990823
 #define OS_WINDOWS (RLIB_OS_ID_MAGIC + 1) 
 #define OS_LINUX   (RLIB_OS_ID_MAGIC + 2) 
 #define OS_MACOS   (RLIB_OS_ID_MAGIC + 3) 
@@ -47,19 +48,19 @@
 
 // shorthand for __cplusplus macro.
 #ifndef RLIB_CXX_STD
-#   if RLIB_COMPILER_ID == CC_MSVC
-#       if defined(__cplusplus)
-#       if __cplusplus == 199711L
-#           pragma message (": warning MSVC_Wrong__cplusplus: Your MSVC is possibly set __cplusplus to wrong value. Please upgrade to VS2017 15.7 Preview 3 and recompile with /Zc:__cplusplus. Or I'll assume you support C++17 and set RLIB_CXX_STD to 2017. (refer to https://blogs.msdn.microsoft.com/vcblog/2018/04/09/msvc-now-correctly-reports-__cplusplus/)")
-#           define RLIB_CXX_STD 2017
+#   if defined(__cplusplus)
+#       if RLIB_COMPILER_ID == CC_MSVC
+#           if __cplusplus == 199711L
+#               pragma message (": warning MSVC_Wrong__cplusplus: Your MSVC is possibly set __cplusplus to wrong value. Please upgrade to VS2017 15.7 Preview 3 and recompile with /Zc:__cplusplus. Or I'll assume you support C++17 and set RLIB_CXX_STD to 2017. (refer to https://blogs.msdn.microsoft.com/vcblog/2018/04/09/msvc-now-correctly-reports-__cplusplus/)")
+#               define RLIB_CXX_STD 2017
+#           else
+#               define RLIB_CXX_STD (__cplusplus / 100L)
+#           endif
 #       else
 #           define RLIB_CXX_STD (__cplusplus / 100L)
 #       endif
-#       endif
 #   else
-#       if defined(__cplusplus)
-#       define RLIB_CXX_STD (__cplusplus / 100L)
-#       endif
+#       define RLIB_CXX_STD 0
 #   endif
 #endif
 
-- 
GitLab