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 |
11 #ifndef WEBRTC_AUDIO_DEVICE_LATEBINDINGSYMBOLTABLE_LINUX_H | 11 #ifndef WEBRTC_AUDIO_DEVICE_LATEBINDINGSYMBOLTABLE_LINUX_H |
12 #define WEBRTC_AUDIO_DEVICE_LATEBINDINGSYMBOLTABLE_LINUX_H | 12 #define WEBRTC_AUDIO_DEVICE_LATEBINDINGSYMBOLTABLE_LINUX_H |
13 | 13 |
14 #include <assert.h> | 14 #include <assert.h> |
15 #include <stddef.h> // for NULL | 15 #include <stddef.h> // for NULL |
16 #include <string.h> | 16 #include <string.h> |
17 | 17 |
18 #include "webrtc/base/constructormagic.h" | 18 #include "webrtc/base/constructormagic.h" |
19 #include "webrtc/system_wrappers/interface/trace.h" | 19 #include "webrtc/system_wrappers/include/trace.h" |
20 | 20 |
21 // This file provides macros for creating "symbol table" classes to simplify the | 21 // This file provides macros for creating "symbol table" classes to simplify the |
22 // dynamic loading of symbols from DLLs. Currently the implementation only | 22 // dynamic loading of symbols from DLLs. Currently the implementation only |
23 // supports Linux and pure C symbols. | 23 // supports Linux and pure C symbols. |
24 // See talk/sound/pulseaudiosymboltable.(h|cc) for an example. | 24 // See talk/sound/pulseaudiosymboltable.(h|cc) for an example. |
25 | 25 |
26 namespace webrtc_adm_linux { | 26 namespace webrtc_adm_linux { |
27 | 27 |
28 #ifdef WEBRTC_LINUX | 28 #ifdef WEBRTC_LINUX |
29 typedef void *DllHandle; | 29 typedef void *DllHandle; |
(...skipping 139 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 |