From 797287a14429c4f1faaf796465e431f8ad38dfdc Mon Sep 17 00:00:00 2001 From: Mina Almasry Date: Mon, 25 Mar 2013 17:53:54 -0400 Subject: [PATCH] Bug 582783 - Move windows.h include and undef LoadImage to gfxWindowsSurface.h. r=joe --- gfx/thebes/gfxWindowsSurface.h | 3 +++ image/build/nsImageModule.cpp | 8 -------- image/src/imgLoader.cpp | 7 ------- image/src/imgRequest.cpp | 8 -------- 4 files changed, 3 insertions(+), 23 deletions(-) diff --git a/gfx/thebes/gfxWindowsSurface.h b/gfx/thebes/gfxWindowsSurface.h index 1cd39884689..b221c359de8 100644 --- a/gfx/thebes/gfxWindowsSurface.h +++ b/gfx/thebes/gfxWindowsSurface.h @@ -9,7 +9,10 @@ #include "gfxASurface.h" #include "gfxImageSurface.h" +/* include windows.h for the HWND and HDC definitions that we need. */ #include +/* undefine LoadImage because our code uses that name */ +#undef LoadImage class gfxContext; diff --git a/image/build/nsImageModule.cpp b/image/build/nsImageModule.cpp index a35512ce367..ea47a49a411 100644 --- a/image/build/nsImageModule.cpp +++ b/image/build/nsImageModule.cpp @@ -9,14 +9,6 @@ #include "RasterImage.h" -/* We end up pulling in windows.h because we eventually hit gfxWindowsSurface; - * windows.h defines LoadImage, so we have to #undef it or imgLoader::LoadImage - * gets changed. - * This #undef needs to be in multiple places because we don't always pull - * headers in in the same order. - */ -#undef LoadImage - #include "imgLoader.h" #include "imgRequest.h" #include "imgRequestProxy.h" diff --git a/image/src/imgLoader.cpp b/image/src/imgLoader.cpp index 4f12140bc6b..9ebf49eebc6 100644 --- a/image/src/imgLoader.cpp +++ b/image/src/imgLoader.cpp @@ -12,13 +12,6 @@ #include "imgRequestProxy.h" #include "RasterImage.h" -/* We end up pulling in windows.h because we eventually hit gfxWindowsSurface; - * windows.h defines LoadImage, so we have to #undef it or imgLoader::LoadImage - * gets changed. - * This #undef needs to be in multiple places because we don't always pull - * headers in in the same order. - */ -#undef LoadImage #include "nsCOMPtr.h" diff --git a/image/src/imgRequest.cpp b/image/src/imgRequest.cpp index d8a7a03790f..c06ceccb601 100644 --- a/image/src/imgRequest.cpp +++ b/image/src/imgRequest.cpp @@ -7,14 +7,6 @@ #include "imgRequest.h" #include "ImageLogging.h" -/* We end up pulling in windows.h because we eventually hit gfxWindowsSurface; - * windows.h defines LoadImage, so we have to #undef it or imgLoader::LoadImage - * gets changed. - * This #undef needs to be in multiple places because we don't always pull - * headers in in the same order. - */ -#undef LoadImage - #include "imgLoader.h" #include "imgRequestProxy.h" #include "imgStatusTracker.h"