summaryrefslogtreecommitdiff
path: root/games/warsow/files/patch-ui_as_asbind.h
blob: 32f8f58dc04eb6ea2895c2bb557215df7da3a83e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
--- ui/as/asbind.h.orig	2012-07-21 13:38:20.000000000 +0400
+++ ui/as/asbind.h	2014-02-06 06:32:49.000000000 +0400
@@ -268,7 +268,7 @@
 	}
 
 	// throw ?
-	template<typename T> const char * typestr() { ctassert<false>(); return "ERROR"; }
+	template<typename T> const char * typestr();
 
 	template<> inline const char *typestr<signed int>() { return "int"; }
 	template<> inline const char *typestr<unsigned int>() { return "uint"; }
@@ -436,13 +436,7 @@
 // function string
 
 template<typename R>
-struct FunctionStringProxy {
-	std::string operator()( const char *s )
-	{
-		ctassert<false>();
-		throw Exception( std::string("FunctionStringProxy base called with " ) + s );
-	}
-};
+struct FunctionStringProxy;
 
 template<typename R>
 struct FunctionStringProxy<R (*)()> {
@@ -539,13 +533,7 @@
 
 // method string
 
-template<typename T> struct MethodStringProxy {
-	std::string operator()( const char *s  )
-	{
-		ctassert<false>();
-		throw Exception( std::string( "MethodStringProxy: base class called in " ) + s );
-	}
-};
+template<typename T> struct MethodStringProxy;
 
 //==
 
@@ -902,17 +890,8 @@
 // functor object to call script-function
 
 // first define structs to get/set arguments (struct to partial-specialize)
-template<typename T> struct SetArg {
-	void operator()( asIScriptContext *ctx, int idx, T &t ) {
-		ctassert<false>();
-	}
-};
-template<typename T> struct GetArg {
-	T operator()() {
-		ctassert<false>();
-		return T();
-	}
-};
+template<typename T> struct SetArg;
+template<typename T> struct GetArg;
 
 template<> struct SetArg<signed int> {
 	void operator()( asIScriptContext *ctx, int idx, signed int &t ) { ctx->SetArgDWord( idx, t ); }
@@ -1042,15 +1021,7 @@
 //=================
 
 template<typename R>
-struct FunctionPtr : FunctionPtrBase {
-	FunctionPtr( asIScriptFunction *fptr=NULL ) : FunctionPtrBase( fptr ) {}
-	R operator()( void )
-	{
-		ctassert<false>();
-		throw std::runtime_error( "FunctionPtr baseclass called!" );
-		return R();
-	}
-};
+struct FunctionPtr;
 
 //==