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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 const char *symbol_name, | 69 const char *symbol_name, |
70 void **symbol) { | 70 void **symbol) { |
71 #ifdef WEBRTC_LINUX | 71 #ifdef WEBRTC_LINUX |
72 *symbol = dlsym(handle, symbol_name); | 72 *symbol = dlsym(handle, symbol_name); |
73 char *err = dlerror(); | 73 char *err = dlerror(); |
74 if (err) { | 74 if (err) { |
75 WEBRTC_TRACE(kTraceError, kTraceAudioDevice, -1, | 75 WEBRTC_TRACE(kTraceError, kTraceAudioDevice, -1, |
76 "Error loading symbol %s : %d", symbol_name, err); | 76 "Error loading symbol %s : %d", symbol_name, err); |
77 return false; | 77 return false; |
78 } else if (!*symbol) { | 78 } else if (!*symbol) { |
79 WEBRTC_TRACE(kTraceError, kTraceAudioDevice, -1, | 79 WEBRTC_TRACE(kTraceError, kTraceAudioDevice, -1, "Symbol %s is null", |
80 "Symbol %s is NULL", symbol_name); | 80 symbol_name); |
81 return false; | 81 return false; |
82 } | 82 } |
83 return true; | 83 return true; |
84 #else | 84 #else |
85 #error Not implemented | 85 #error Not implemented |
86 #endif | 86 #endif |
87 } | 87 } |
88 | 88 |
89 // This routine MUST assign SOME value for every symbol, even if that value is | 89 // This routine MUST assign SOME value for every symbol, even if that value is |
90 // NULL, or else some symbols may be left with uninitialized data that the | 90 // null, or else some symbols may be left with uninitialized data that the |
91 // caller may later interpret as a valid address. | 91 // caller may later interpret as a valid address. |
92 bool InternalLoadSymbols(DllHandle handle, | 92 bool InternalLoadSymbols(DllHandle handle, |
93 int num_symbols, | 93 int num_symbols, |
94 const char *const symbol_names[], | 94 const char *const symbol_names[], |
95 void *symbols[]) { | 95 void *symbols[]) { |
96 #ifdef WEBRTC_LINUX | 96 #ifdef WEBRTC_LINUX |
97 // Clear any old errors. | 97 // Clear any old errors. |
98 dlerror(); | 98 dlerror(); |
99 #endif | 99 #endif |
100 for (int i = 0; i < num_symbols; ++i) { | 100 for (int i = 0; i < num_symbols; ++i) { |
101 if (!LoadSymbol(handle, symbol_names[i], &symbols[i])) { | 101 if (!LoadSymbol(handle, symbol_names[i], &symbols[i])) { |
102 return false; | 102 return false; |
103 } | 103 } |
104 } | 104 } |
105 return true; | 105 return true; |
106 } | 106 } |
107 | 107 |
108 } // namespace webrtc_adm_linux | 108 } // namespace webrtc_adm_linux |
OLD | NEW |