OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2010 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2010 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 assert(IsLoaded()); | 112 assert(IsLoaded()); |
113 assert(index < NumSymbols()); | 113 assert(index < NumSymbols()); |
114 return symbols_[index]; | 114 return symbols_[index]; |
115 } | 115 } |
116 | 116 |
117 private: | 117 private: |
118 DllHandle handle_; | 118 DllHandle handle_; |
119 bool undefined_symbols_; | 119 bool undefined_symbols_; |
120 void *symbols_[SYMBOL_TABLE_SIZE]; | 120 void *symbols_[SYMBOL_TABLE_SIZE]; |
121 | 121 |
122 DISALLOW_COPY_AND_ASSIGN(LateBindingSymbolTable); | 122 RTC_DISALLOW_COPY_AND_ASSIGN(LateBindingSymbolTable); |
123 }; | 123 }; |
124 | 124 |
125 // This macro must be invoked in a header to declare a symbol table class. | 125 // This macro must be invoked in a header to declare a symbol table class. |
126 #define LATE_BINDING_SYMBOL_TABLE_DECLARE_BEGIN(ClassName) \ | 126 #define LATE_BINDING_SYMBOL_TABLE_DECLARE_BEGIN(ClassName) \ |
127 enum { | 127 enum { |
128 | 128 |
129 // This macro must be invoked in the header declaration once for each symbol | 129 // This macro must be invoked in the header declaration once for each symbol |
130 // (recommended to use an X-Macro to avoid duplication). | 130 // (recommended to use an X-Macro to avoid duplication). |
131 // This macro defines an enum with names built from the symbols, which | 131 // This macro defines an enum with names built from the symbols, which |
132 // essentially creates a hash table in the compiler from symbol names to their | 132 // essentially creates a hash table in the compiler from symbol names to their |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 (ClassName##_SYMBOL_TABLE_INDEX_##sym) | 169 (ClassName##_SYMBOL_TABLE_INDEX_##sym) |
170 | 170 |
171 // Returns a reference to the given late-binded symbol, with the correct type. | 171 // Returns a reference to the given late-binded symbol, with the correct type. |
172 #define LATESYM_GET(ClassName, inst, sym) \ | 172 #define LATESYM_GET(ClassName, inst, sym) \ |
173 (*reinterpret_cast<typeof(&sym)>( \ | 173 (*reinterpret_cast<typeof(&sym)>( \ |
174 (inst)->GetSymbol(LATESYM_INDEXOF(ClassName, sym)))) | 174 (inst)->GetSymbol(LATESYM_INDEXOF(ClassName, sym)))) |
175 | 175 |
176 } // namespace webrtc_adm_linux | 176 } // namespace webrtc_adm_linux |
177 | 177 |
178 #endif // WEBRTC_ADM_LATEBINDINGSYMBOLTABLE_LINUX_H | 178 #endif // WEBRTC_ADM_LATEBINDINGSYMBOLTABLE_LINUX_H |
OLD | NEW |