Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: compiled/bindings/generator.h

Issue 29431555: Issue 5216 - [emscripten] Use a more reliable way of retrieving mangled function name (Closed) Base URL: https://hg.adblockplus.org/adblockpluscore
Patch Set: Use std::string for function name rather than std::vector Created May 8, 2017, 10:12 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2017 eyeo GmbH 3 * Copyright (C) 2006-2017 eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 char TypeInfo<T>::s_typeIDHelper; 112 char TypeInfo<T>::s_typeIDHelper;
113 113
114 struct FunctionInfo 114 struct FunctionInfo
115 { 115 {
116 TypeCategory returnType; 116 TypeCategory returnType;
117 TYPEID pointerType; 117 TYPEID pointerType;
118 std::vector<TypeCategory> args; 118 std::vector<TypeCategory> args;
119 bool instance_function; 119 bool instance_function;
120 int effectiveArgs; 120 int effectiveArgs;
121 TypeCategory effectiveReturnType; 121 TypeCategory effectiveReturnType;
122 char name[1024]; 122 std::string name;
123 123
124 FunctionInfo(); 124 FunctionInfo();
125 125
126 FunctionInfo(TypeCategory returnType, TYPEID pointerType, 126 FunctionInfo(TypeCategory returnType, TYPEID pointerType,
127 std::initializer_list<TypeCategory> argTypes, bool instance_function, 127 std::initializer_list<TypeCategory> argTypes, bool instance_function,
128 void* function); 128 void* function);
129 129
130 template<typename ReturnType, typename... Args> 130 template<typename ReturnType, typename... Args>
131 FunctionInfo(ReturnType (*function)(Args...)) 131 FunctionInfo(ReturnType (*function)(Args...))
132 : FunctionInfo(TypeInfo<ReturnType>(), 132 : FunctionInfo(TypeInfo<ReturnType>(),
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
337 337
338 template<typename ReturnType, typename... Args> 338 template<typename ReturnType, typename... Args>
339 namespace_& function(const char* name, ReturnType (*method)(Args...)) 339 namespace_& function(const char* name, ReturnType (*method)(Args...))
340 { 340 {
341 bindings_internal::register_namespace_method(mName, name, method); 341 bindings_internal::register_namespace_method(mName, name, method);
342 return *this; 342 return *this;
343 } 343 }
344 }; 344 };
345 345
346 void printBindings(); 346 void printBindings();
OLDNEW

Powered by Google App Engine
This is Rietveld