OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // be found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "native_client/src/trusted/plugin/dylib_unittest.h" | 5 #include "native_client/src/trusted/plugin/dylib_unittest.h" |
6 | 6 |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 | 8 |
9 #if NACL_WINDOWS | 9 #if NACL_WINDOWS |
10 DylibHandle DylibOpen(const char* lib_path) { | 10 DylibHandle DylibOpen(const char* lib_path) { |
11 return LoadLibrary(lib_path); | 11 return LoadLibrary(lib_path); |
12 } | 12 } |
13 | 13 |
(...skipping 18 matching lines...) Expand all Loading... |
32 SymbolHandle GetSymbolHandle(DylibHandle dl_handle, const char* name) { | 32 SymbolHandle GetSymbolHandle(DylibHandle dl_handle, const char* name) { |
33 void* sym_handle = dlsym(dl_handle, name); | 33 void* sym_handle = dlsym(dl_handle, name); |
34 char* error_string = dlerror(); | 34 char* error_string = dlerror(); |
35 if (sym_handle == NULL || error_string != NULL) { | 35 if (sym_handle == NULL || error_string != NULL) { |
36 fprintf(stderr, "Couldn't get symbol %s: %s\n", name, error_string); | 36 fprintf(stderr, "Couldn't get symbol %s: %s\n", name, error_string); |
37 sym_handle = NULL; | 37 sym_handle = NULL; |
38 } | 38 } |
39 return reinterpret_cast<SymbolHandle>(sym_handle); | 39 return reinterpret_cast<SymbolHandle>(sym_handle); |
40 } | 40 } |
41 #endif | 41 #endif |
OLD | NEW |