Quellcode durchsuchen

Fix bug with Clang where wrapped function pointers are optimized out

Ole vor 10 Jahren
Ursprung
Commit
1fb8e0391e
1 geänderte Dateien mit 4 neuen und 5 gelöschten Zeilen
  1. 4 5
      lib/luwra/functions.hpp

+ 4 - 5
lib/luwra/functions.hpp

@@ -70,10 +70,6 @@ namespace internal {
 	template <typename R, typename... A>
 	struct FunctionWrapperHelper<R(*)(A...)> {
 		using Signature = R(A...);
-
-		template <R(*function_pointer)(A...)> static
-		constexpr CFunction wrapped =
-			&internal::FunctionWrapper<Signature>::template invoke<function_pointer>;
 	};
 }
 
@@ -101,7 +97,10 @@ constexpr CFunction wrap_function =
  * This macros allows you to wrap functions without providing a type signature.
  */
 #define LUWRA_WRAP_FUNCTION(fun) \
-	(luwra::internal::FunctionWrapperHelper<decltype(&fun)>::wrapped<&fun>)
+	(luwra::wrap_function< \
+	     typename luwra::internal::FunctionWrapperHelper<decltype(&fun)>::Signature, \
+	     &fun \
+	 >)
 
 LUWRA_NS_END