瀏覽代碼

Prevent name collisions in the registry

Ole 9 年之前
父節點
當前提交
daa16fb669
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      lib/luwra/usertypes.hpp

+ 5 - 1
lib/luwra/usertypes.hpp

@@ -41,8 +41,12 @@ namespace internal {
 	template <typename T>
 	const int UserTypeReg<T>::id = INT_MAX;
 
+	#ifndef LUWRA_REGISTRY_PREFIX
+		#define LUWRA_REGISTRY_PREFIX "Luwra#"
+	#endif
+
 	template <typename T>
-	const std::string UserTypeReg<T>::name = "UD#" + std::to_string(uintptr_t(&id));
+	const std::string UserTypeReg<T>::name = LUWRA_REGISTRY_PREFIX + std::to_string(uintptr_t(&id));
 
 	/**
 	 * Register a new metatable for a user type T.