Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(375)

Unified Diff: base/native_library.h

Issue 115896: Making the browser tests work on Unix (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/native_library.h
===================================================================
--- base/native_library.h (revision 17736)
+++ base/native_library.h (working copy)
@@ -16,19 +16,36 @@
#import <Carbon/Carbon.h>
#endif // OS_*
+#include "base/string16.h"
+
+// Macro usefull for writing cross-platform function pointers.
+#if defined(OS_WIN) && !defined(CDECL)
+#define CDECL __cdecl
+#else
+#define CDECL
+#endif
+
class FilePath;
namespace base {
#if defined(OS_WIN)
typedef HMODULE NativeLibrary;
-typedef char* NativeLibraryFunctionNameType;
#elif defined(OS_MACOSX)
-typedef CFBundleRef NativeLibrary;
-typedef CFStringRef NativeLibraryFunctionNameType;
+enum NativeLibraryType {
+ BUNDLE,
+ DYNAMIC_LIB
+};
+struct NativeLibraryStruct {
+ NativeLibraryType type;
+ union {
+ CFBundleRef bundle;
+ void* dylib;
+ };
+};
+typedef NativeLibraryStruct* NativeLibrary;
#elif defined(OS_LINUX)
typedef void* NativeLibrary;
-typedef const char* NativeLibraryFunctionNameType;
#endif // OS_*
// Loads a native library from disk. Release it with UnloadNativeLibrary when
@@ -40,8 +57,14 @@
// Gets a function pointer from a native library.
void* GetFunctionPointerFromNativeLibrary(NativeLibrary library,
- NativeLibraryFunctionNameType name);
+ const char* name);
+// Returns the full platform specific name for a native library.
+// For example:
+// "mylib" returns "mylib.dll" on Windows, "libmylib.so" on Linux,
+// "mylib.dylib" on Mac.
+string16 GetNativeLibraryName(const string16& name);
+
} // namespace base
#endif // BASE_NATIVE_LIBRARY_H_
« no previous file with comments | « base/command_line.cc ('k') | base/native_library_linux.cc » ('j') | chrome/chrome.gyp » ('J')

Powered by Google App Engine
This is Rietveld 408576698