Commit 464bfc86 by Jacek Caban Committed by Jamie Madill

Use .def file to export functions using dllexport.

BUG=angleproject:1183 This is a reland of part of commit 56627322. The original commit caused warnings on 64-bit MSVC linker. This version removes declspec(dllexport) from exported ANGLE APIs (for which we need a new ANGLE_PLATFORM_EXPORT macro). It also makes those APIs stdcall on Windows builds. Change-Id: Iee2ab7e43ef0b98924f5759b5e1b333307052235 Reviewed-on: https://chromium-review.googlesource.com/304501Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
parent d470f472
...@@ -11,7 +11,24 @@ ...@@ -11,7 +11,24 @@
#include <stdint.h> #include <stdint.h>
#include "../export.h" #if defined(_WIN32)
# if !defined(LIBANGLE_IMPLEMENTATION)
# define ANGLE_PLATFORM_EXPORT __declspec(dllimport)
# endif
#elif defined(__GNUC__)
# if defined(LIBANGLE_IMPLEMENTATION)
# define ANGLE_PLATFORM_EXPORT __attribute__((visibility ("default")))
# endif
#endif
#if !defined(ANGLE_PLATFORM_EXPORT)
# define ANGLE_PLATFORM_EXPORT
#endif
#if defined(_WIN32)
# define ANGLE_APIENTRY __stdcall
#else
# define ANGLE_APIENTRY
#endif
namespace angle namespace angle
{ {
...@@ -134,13 +151,18 @@ class Platform ...@@ -134,13 +151,18 @@ class Platform
} }
typedef void(*ANGLEPlatformInitializeFunc)(angle::Platform*); extern "C"
ANGLE_EXPORT void ANGLEPlatformInitialize(angle::Platform*); {
typedef void (ANGLE_APIENTRY *ANGLEPlatformInitializeFunc)(angle::Platform*);
ANGLE_PLATFORM_EXPORT void ANGLE_APIENTRY ANGLEPlatformInitialize(angle::Platform*);
typedef void (*ANGLEPlatformShutdownFunc)(); typedef void (ANGLE_APIENTRY *ANGLEPlatformShutdownFunc)();
ANGLE_EXPORT void ANGLEPlatformShutdown(); ANGLE_PLATFORM_EXPORT void ANGLE_APIENTRY ANGLEPlatformShutdown();
typedef angle::Platform *(*ANGLEPlatformCurrentFunc)(); typedef angle::Platform *(ANGLE_APIENTRY *ANGLEPlatformCurrentFunc)();
ANGLE_EXPORT angle::Platform *ANGLEPlatformCurrent(); ANGLE_PLATFORM_EXPORT angle::Platform *ANGLE_APIENTRY ANGLEPlatformCurrent();
}
#endif // ANGLE_PLATFORM_H #endif // ANGLE_PLATFORM_H
...@@ -16,20 +16,20 @@ angle::Platform *currentPlatform = nullptr; ...@@ -16,20 +16,20 @@ angle::Platform *currentPlatform = nullptr;
} }
// static // static
ANGLE_EXPORT angle::Platform *ANGLEPlatformCurrent() angle::Platform *ANGLE_APIENTRY ANGLEPlatformCurrent()
{ {
return currentPlatform; return currentPlatform;
} }
// static // static
ANGLE_EXPORT void ANGLEPlatformInitialize(angle::Platform *platformImpl) void ANGLE_APIENTRY ANGLEPlatformInitialize(angle::Platform *platformImpl)
{ {
ASSERT(platformImpl != nullptr); ASSERT(platformImpl != nullptr);
currentPlatform = platformImpl; currentPlatform = platformImpl;
} }
// static // static
ANGLE_EXPORT void ANGLEPlatformShutdown() void ANGLE_APIENTRY ANGLEPlatformShutdown()
{ {
currentPlatform = nullptr; currentPlatform = nullptr;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment