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 @@
#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
{
......@@ -134,13 +151,18 @@ class Platform
}
typedef void(*ANGLEPlatformInitializeFunc)(angle::Platform*);
ANGLE_EXPORT void ANGLEPlatformInitialize(angle::Platform*);
extern "C"
{
typedef void (ANGLE_APIENTRY *ANGLEPlatformInitializeFunc)(angle::Platform*);
ANGLE_PLATFORM_EXPORT void ANGLE_APIENTRY ANGLEPlatformInitialize(angle::Platform*);
typedef void (*ANGLEPlatformShutdownFunc)();
ANGLE_EXPORT void ANGLEPlatformShutdown();
typedef void (ANGLE_APIENTRY *ANGLEPlatformShutdownFunc)();
ANGLE_PLATFORM_EXPORT void ANGLE_APIENTRY ANGLEPlatformShutdown();
typedef angle::Platform *(*ANGLEPlatformCurrentFunc)();
ANGLE_EXPORT angle::Platform *ANGLEPlatformCurrent();
typedef angle::Platform *(ANGLE_APIENTRY *ANGLEPlatformCurrentFunc)();
ANGLE_PLATFORM_EXPORT angle::Platform *ANGLE_APIENTRY ANGLEPlatformCurrent();
}
#endif // ANGLE_PLATFORM_H
......@@ -16,20 +16,20 @@ angle::Platform *currentPlatform = nullptr;
}
// static
ANGLE_EXPORT angle::Platform *ANGLEPlatformCurrent()
angle::Platform *ANGLE_APIENTRY ANGLEPlatformCurrent()
{
return currentPlatform;
}
// static
ANGLE_EXPORT void ANGLEPlatformInitialize(angle::Platform *platformImpl)
void ANGLE_APIENTRY ANGLEPlatformInitialize(angle::Platform *platformImpl)
{
ASSERT(platformImpl != nullptr);
currentPlatform = platformImpl;
}
// static
ANGLE_EXPORT void ANGLEPlatformShutdown()
void ANGLE_APIENTRY ANGLEPlatformShutdown()
{
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