| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/native_library.h" | 5 #include "base/native_library.h" |
| 6 | 6 |
| 7 #include <dlfcn.h> | 7 #include <dlfcn.h> |
| 8 #import <Carbon/Carbon.h> | 8 #import <Carbon/Carbon.h> |
| 9 | 9 |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 return CFBundleGetFunctionPointerForName(library->bundle, symbol_name); | 66 return CFBundleGetFunctionPointerForName(library->bundle, symbol_name); |
| 67 } | 67 } |
| 68 return dlsym(library->dylib, name); | 68 return dlsym(library->dylib, name); |
| 69 } | 69 } |
| 70 | 70 |
| 71 // static | 71 // static |
| 72 string16 GetNativeLibraryName(const string16& name) { | 72 string16 GetNativeLibraryName(const string16& name) { |
| 73 return name + ASCIIToUTF16(".dylib"); | 73 return name + ASCIIToUTF16(".dylib"); |
| 74 } | 74 } |
| 75 | 75 |
| 76 string16 GetLibraryErrorMessage() { |
| 77 const char* last_err_message = dlerror(); |
| 78 string16 err_message; |
| 79 |
| 80 if (last_err_message) { |
| 81 err_message = ASCIIToUTF16(last_err_message); |
| 82 } |
| 83 |
| 84 return err_message; |
| 85 } |
| 86 |
| 76 } // namespace base | 87 } // namespace base |
| OLD | NEW |