Jelajahi Sumber

Use namespace in defs.hpp

A global alias of godot::real_t is defined for backward compatibility

(cherry picked from commit 450c3d65cd182b3e33a1deeae250143e699f7972)
Zhehang Ding 11 bulan lalu
induk
melakukan
cb41b472f4
1 mengubah file dengan 8 tambahan dan 0 penghapusan
  1. 8 0
      include/godot_cpp/core/defs.hpp

+ 8 - 0
include/godot_cpp/core/defs.hpp

@@ -35,6 +35,8 @@
 #include <cstdint>
 #include <cstring>
 
+namespace godot {
+
 #if !defined(GDE_EXPORT)
 #if defined(_WIN32)
 #define GDE_EXPORT __declspec(dllexport)
@@ -127,4 +129,10 @@ struct BuildIndexSequence : BuildIndexSequence<N - 1, N - 1, Is...> {};
 template <size_t... Is>
 struct BuildIndexSequence<0, Is...> : IndexSequence<Is...> {};
 
+} //namespace godot
+
+// To maintain compatibility an alias is defined outside the namespace.
+// Consider it deprecated.
+using real_t = godot::real_t;
+
 #endif // GODOT_DEFS_HPP