diff --git a/configure.in b/configure.in index e02047bab7c6..68fec442e47b 100644 --- a/configure.in +++ b/configure.in @@ -7719,6 +7719,7 @@ XPCOM_LIBS="$LIBXUL_LIBS" if test "$OS_ARCH" = "WINNT"; then GKMEDIAS_SHARED_LIBRARY=1 + AC_DEFINE(GKMEDIAS_SHARED_LIBRARY) fi AC_SUBST(GKMEDIAS_SHARED_LIBRARY) diff --git a/gfx/2d/Factory.cpp b/gfx/2d/Factory.cpp index 86f740c235eb..501dcb11e254 100644 --- a/gfx/2d/Factory.cpp +++ b/gfx/2d/Factory.cpp @@ -53,7 +53,7 @@ #include "mozilla/CheckedInt.h" -#ifdef PR_LOGGING +#if defined(DEBUG) || defined(PR_LOGGING) PRLogModuleInfo * GetGFX2DLog() { @@ -156,7 +156,7 @@ namespace mozilla { namespace gfx { // XXX - Need to define an API to set this. -int sGfxLogLevel = LOG_DEBUG; +GFX2D_API int sGfxLogLevel = LOG_DEBUG; #ifdef WIN32 ID3D10Device1 *Factory::mD3D10Device; diff --git a/gfx/2d/Logging.h b/gfx/2d/Logging.h index 4b6bda276aac..f508f6aebd5b 100644 --- a/gfx/2d/Logging.h +++ b/gfx/2d/Logging.h @@ -14,10 +14,17 @@ #include "Matrix.h" #ifdef WIN32 -#include +// This file gets included from nsGlobalWindow.cpp, which doesn't like +// having windows.h included in it. Since OutputDebugStringA is the only +// thing we need from windows.h, we just declare it here directly. +// Note: the function's documented signature is +// WINBASEAPI void WINAPI OutputDebugStringA(LPCSTR lpOutputString) +// but if we don't include windows.h, the macros WINBASEAPI, WINAPI, and +// LPCSTR are not defined, so we need to replace them with their expansions. +extern "C" __declspec(dllimport) void __stdcall OutputDebugStringA(const char* lpOutputString); #endif -#ifdef PR_LOGGING +#if defined(DEBUG) || defined(PR_LOGGING) #include extern PRLogModuleInfo *GetGFX2DLog(); @@ -29,7 +36,7 @@ namespace gfx { const int LOG_DEBUG = 1; const int LOG_WARNING = 2; -#ifdef PR_LOGGING +#if defined(DEBUG) || defined(PR_LOGGING) inline PRLogModuleLevel PRLogLevelForLevel(int aLevel) { switch (aLevel) { @@ -43,7 +50,7 @@ inline PRLogModuleLevel PRLogLevelForLevel(int aLevel) { #endif -extern int sGfxLogLevel; +extern GFX2D_API int sGfxLogLevel; static inline void OutputMessage(const std::string &aString, int aLevel) { #if defined(WIN32) && !defined(PR_LOGGING) diff --git a/gfx/2d/Rect.h b/gfx/2d/Rect.h index 647244284357..7f52af898351 100644 --- a/gfx/2d/Rect.h +++ b/gfx/2d/Rect.h @@ -97,7 +97,7 @@ struct RectTyped : Super(float(rect.x), float(rect.y), float(rect.width), float(rect.height)) {} - GFX2D_API void NudgeToIntegers() + void NudgeToIntegers() { NudgeToInteger(&(this->x)); NudgeToInteger(&(this->y)); diff --git a/gfx/2d/Types.h b/gfx/2d/Types.h index ec0943334470..f59e8956d737 100644 --- a/gfx/2d/Types.h +++ b/gfx/2d/Types.h @@ -246,7 +246,7 @@ struct GradientStop } } -#if defined(XP_WIN) && defined(MOZ_GFX) +#if defined(XP_WIN) && defined(GKMEDIAS_SHARED_LIBRARY) #ifdef GFX2D_INTERNAL #define GFX2D_API __declspec(dllexport) #else diff --git a/gfx/2d/moz.build b/gfx/2d/moz.build index c2b7518eb1c4..c1b7cda628a1 100644 --- a/gfx/2d/moz.build +++ b/gfx/2d/moz.build @@ -21,6 +21,7 @@ EXPORTS.mozilla.gfx += [ 'DataSurfaceHelpers.h', 'Filters.h', 'Helpers.h', + 'Logging.h', 'Matrix.h', 'PathHelpers.h', 'Point.h',