Skip to content

Commit

Permalink
eliminate SK_BUILD_FOR_WIN32
Browse files Browse the repository at this point in the history
SK_BUILD_FOR_WIN and SK_BUILD_FOR_WIN32 have long meant the same thing.

Chrome fix is https://chromium-review.googlesource.com/c/chromium/src/+/884007

Change-Id: I0e907b1bcd2a358eabf776f414fd3aeb3c689561
Reviewed-on: https://skia-review.googlesource.com/99340
Reviewed-by: Mike Reed <[email protected]>
  • Loading branch information
Mike Klein committed Jan 26, 2018
1 parent 53d57ac commit 8f11d4d
Show file tree
Hide file tree
Showing 49 changed files with 82 additions and 86 deletions.
2 changes: 1 addition & 1 deletion bench/nanobench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

extern bool gSkForceRasterPipelineBlitter;

#ifndef SK_BUILD_FOR_WIN32
#ifndef SK_BUILD_FOR_WIN
#include <unistd.h>
#endif

Expand Down
2 changes: 1 addition & 1 deletion debugger/debuggermain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ static void usage(const char * argv0) {
}

int main(int argc, char *argv[]) {
#ifndef SK_BUILD_FOR_WIN32
#ifndef SK_BUILD_FOR_WIN
// Set numeric formatting to default. Otherwise shaders will have numbers with wrong comma.
// QApplication documentation recommends setlocale("LC_NUMERIC", "C") after QApplication
// constuction. However, the components Qt calls (X11 libs, ..) will override that.
Expand Down
6 changes: 3 additions & 3 deletions dm/DM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ extern void SkPDFImageDumpStats();

#include <stdlib.h>

#ifndef SK_BUILD_FOR_WIN32
#ifndef SK_BUILD_FOR_WIN
#include <unistd.h>
#endif

Expand Down Expand Up @@ -212,7 +212,7 @@ static void find_culprit() {
}
}

#if defined(SK_BUILD_FOR_WIN32)
#if defined(SK_BUILD_FOR_WIN)
static LONG WINAPI crash_handler(EXCEPTION_POINTERS* e) {
static const struct {
const char* name;
Expand Down Expand Up @@ -339,7 +339,7 @@ static void gather_gold() {

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/

#if defined(SK_BUILD_FOR_WIN32)
#if defined(SK_BUILD_FOR_WIN)
static const char* kNewline = "\r\n";
#else
static const char* kNewline = "\n";
Expand Down
6 changes: 1 addition & 5 deletions include/core/SkPostConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
#ifndef SkPostConfig_DEFINED
#define SkPostConfig_DEFINED

#if defined(SK_BUILD_FOR_WIN32)
# define SK_BUILD_FOR_WIN
#endif

#if !defined(SK_DEBUG) && !defined(SK_RELEASE)
#ifdef NDEBUG
#define SK_RELEASE
Expand Down Expand Up @@ -207,7 +203,7 @@

//////////////////////////////////////////////////////////////////////////////////////////////

#if defined SK_DEBUG && defined SK_BUILD_FOR_WIN32
#if defined SK_DEBUG && defined SK_BUILD_FOR_WIN
# ifdef free
# undef free
# endif
Expand Down
6 changes: 3 additions & 3 deletions include/core/SkPreConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@

//////////////////////////////////////////////////////////////////////

#if !defined(SK_BUILD_FOR_ANDROID) && !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_WIN32) && !defined(SK_BUILD_FOR_UNIX) && !defined(SK_BUILD_FOR_MAC)
#if !defined(SK_BUILD_FOR_ANDROID) && !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_WIN) && !defined(SK_BUILD_FOR_UNIX) && !defined(SK_BUILD_FOR_MAC)

#ifdef __APPLE__
#include "TargetConditionals.h"
#endif

#if defined(_WIN32) || defined(__SYMBIAN32__)
#define SK_BUILD_FOR_WIN32
#define SK_BUILD_FOR_WIN
#elif defined(ANDROID) || defined(__ANDROID__)
#define SK_BUILD_FOR_ANDROID
#elif defined(linux) || defined(__linux) || defined(__FreeBSD__) || \
Expand All @@ -52,7 +52,7 @@

//////////////////////////////////////////////////////////////////////

#ifdef SK_BUILD_FOR_WIN32
#ifdef SK_BUILD_FOR_WIN
#if !defined(SK_RESTRICT)
#define SK_RESTRICT __restrict
#endif
Expand Down
4 changes: 2 additions & 2 deletions include/gpu/GrConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////

#if defined(SK_BUILD_FOR_WIN32)
#if defined(SK_BUILD_FOR_WIN)
// VC8 doesn't support stdint.h, so we define those types here.
typedef signed char int8_t;
typedef unsigned char uint8_t;
Expand Down Expand Up @@ -116,7 +116,7 @@ typedef unsigned __int64 uint64_t;
* GR_ALWAYSBREAK is an unconditional break in all builds.
*/
#if !defined(GR_ALWAYSBREAK)
#if defined(SK_BUILD_FOR_WIN32)
#if defined(SK_BUILD_FOR_WIN)
#define GR_ALWAYSBREAK SkNO_RETURN_HINT(); __debugbreak()
#else
// TODO: do other platforms really not have continuable breakpoints?
Expand Down
2 changes: 1 addition & 1 deletion include/gpu/gl/GrGLConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#endif

#if !defined(GR_GL_FUNCTION_TYPE)
#if defined(SK_BUILD_FOR_WIN32)
#if defined(SK_BUILD_FOR_WIN)
#define GR_GL_FUNCTION_TYPE __stdcall
#else
#define GR_GL_FUNCTION_TYPE
Expand Down
2 changes: 1 addition & 1 deletion include/gpu/vk/GrVkDefines.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
// This is deprecated and all clients should define their own custum header shim that sets up
// defines and includes the vulkan.h header. Then they should define SK_VULKAN_HEADER or set the
// skia_vulkan_header in gn to point to their custom header.
# if defined(SK_BUILD_FOR_WIN) || defined(SK_BUILD_FOR_WIN32)
# if defined(SK_BUILD_FOR_WIN)
# if !defined(VK_USE_PLATFORM_WIN32_KHR)
# define VK_USE_PLATFORM_WIN32_KHR
# endif
Expand Down
2 changes: 1 addition & 1 deletion samplecode/SampleChineseFling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ static void make_paint(SkPaint* paint, sk_sp<SkTypeface> typeface) {
static sk_sp<SkTypeface> chinese_typeface() {
#ifdef SK_BUILD_FOR_ANDROID
return MakeResourceAsTypeface("fonts/NotoSansCJK-Regular.ttc");
#elif defined(SK_BUILD_FOR_WIN32)
#elif defined(SK_BUILD_FOR_WIN)
return SkTypeface::MakeFromName("SimSun", SkFontStyle());
#elif defined(SK_BUILD_FOR_MAC)
return SkTypeface::MakeFromName("Hiragino Sans GB W3", SkFontStyle());
Expand Down
2 changes: 1 addition & 1 deletion src/core/SkCpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#endif

#if defined(SK_CPU_X86)
#if defined(SK_BUILD_FOR_WIN32)
#if defined(SK_BUILD_FOR_WIN)
#include <intrin.h>
static void cpuid (uint32_t abcd[4]) { __cpuid ((int*)abcd, 1); }
static void cpuid7(uint32_t abcd[4]) { __cpuidex((int*)abcd, 7, 0); }
Expand Down
2 changes: 1 addition & 1 deletion src/core/SkExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include <deque>
#include <thread>

#if defined(SK_BUILD_FOR_WIN32)
#if defined(SK_BUILD_FOR_WIN)
#include <windows.h>
static int num_cores() {
SYSTEM_INFO sysinfo;
Expand Down
2 changes: 1 addition & 1 deletion src/core/SkMathPriv.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ static inline float SkPinToUnitFloat(float x) {
int SkCLZ_portable(uint32_t);

#ifndef SkCLZ
#if defined(SK_BUILD_FOR_WIN32)
#if defined(SK_BUILD_FOR_WIN)
#include <intrin.h>

static inline int SkCLZ(uint32_t mask) {
Expand Down
2 changes: 1 addition & 1 deletion src/core/SkSemaphore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
AnnotateHappensAfter(__FILE__, __LINE__, &fSemaphore);
}
};
#elif defined(SK_BUILD_FOR_WIN32)
#elif defined(SK_BUILD_FOR_WIN)
struct SkBaseSemaphore::OSSemaphore {
HANDLE fSemaphore;

Expand Down
6 changes: 3 additions & 3 deletions src/core/SkTime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ void SkTime::DateTime::toISO8601(SkString* dst) const {
}
}

#ifdef SK_BUILD_FOR_WIN32
#ifdef SK_BUILD_FOR_WIN

void SkTime::GetDateTime(DateTime* dt) {
if (dt) {
Expand All @@ -43,7 +43,7 @@ void SkTime::GetDateTime(DateTime* dt) {
}
}

#else // SK_BUILD_FOR_WIN32
#else // SK_BUILD_FOR_WIN

#include <time.h>
void SkTime::GetDateTime(DateTime* dt) {
Expand All @@ -62,7 +62,7 @@ void SkTime::GetDateTime(DateTime* dt) {
dt->fSecond = SkToU8(tstruct.tm_sec);
}
}
#endif // SK_BUILD_FOR_WIN32
#endif // SK_BUILD_FOR_WIN

#if !defined(__has_feature)
#define __has_feature(x) 0
Expand Down
4 changes: 2 additions & 2 deletions src/gpu/gl/GrGLGpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2552,7 +2552,7 @@ void GrGLGpu::flushViewport(const GrGLIRect& viewport) {
#if SWAP_PER_DRAW
#if defined(SK_BUILD_FOR_MAC)
#include <AGL/agl.h>
#elif defined(SK_BUILD_FOR_WIN32)
#elif defined(SK_BUILD_FOR_WIN)
#include <gl/GL.h>
void SwapBuf() {
DWORD procID = GetCurrentProcessId();
Expand Down Expand Up @@ -2615,7 +2615,7 @@ void GrGLGpu::draw(const GrPipeline& pipeline,
aglSwapBuffers(aglGetCurrentContext());
int set_a_break_pt_here = 9;
aglSwapBuffers(aglGetCurrentContext());
#elif defined(SK_BUILD_FOR_WIN32)
#elif defined(SK_BUILD_FOR_WIN)
SwapBuf();
int set_a_break_pt_here = 9;
SwapBuf();
Expand Down
4 changes: 2 additions & 2 deletions src/gpu/gl/win/GrGLMakeNativeInterface_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* found in the LICENSE file.
*/
#include "SkTypes.h"
#if defined(SK_BUILD_FOR_WIN32)
#if defined(SK_BUILD_FOR_WIN)

#include "SkLeanWindows.h"

Expand Down Expand Up @@ -89,4 +89,4 @@ sk_sp<const GrGLInterface> GrGLMakeNativeInterface() {

const GrGLInterface* GrGLCreateNativeInterface() { return GrGLMakeNativeInterface().release(); }

#endif//defined(SK_BUILD_FOR_WIN32)
#endif//defined(SK_BUILD_FOR_WIN)
2 changes: 1 addition & 1 deletion src/pdf/SkPDFDocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void SkPDFObjectSerializer::addObjectRecursively(const sk_sp<SkPDFObject>& objec
}

#define SKPDF_MAGIC "\xD3\xEB\xE9\xE1"
#ifndef SK_BUILD_FOR_WIN32
#ifndef SK_BUILD_FOR_WIN
static_assert((SKPDF_MAGIC[0] & 0x7F) == "Skia"[0], "");
static_assert((SKPDF_MAGIC[1] & 0x7F) == "Skia"[1], "");
static_assert((SKPDF_MAGIC[2] & 0x7F) == "Skia"[2], "");
Expand Down
4 changes: 2 additions & 2 deletions src/ports/SkDebug_stdio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

#include "SkTypes.h"
#if !defined(SK_BUILD_FOR_WIN32) && !defined(SK_BUILD_FOR_ANDROID)
#if !defined(SK_BUILD_FOR_WIN) && !defined(SK_BUILD_FOR_ANDROID)

#include <stdarg.h>
#include <stdio.h>
Expand All @@ -17,4 +17,4 @@ void SkDebugf(const char format[], ...) {
vfprintf(stderr, format, args);
va_end(args);
}
#endif//!defined(SK_BUILD_FOR_WIN32) && !defined(SK_BUILD_FOR_ANDROID)
#endif//!defined(SK_BUILD_FOR_WIN) && !defined(SK_BUILD_FOR_ANDROID)
4 changes: 2 additions & 2 deletions src/ports/SkDebug_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include "SkTypes.h"

#if defined(SK_BUILD_FOR_WIN32)
#if defined(SK_BUILD_FOR_WIN)

#include "SkLeanWindows.h"

Expand All @@ -31,4 +31,4 @@ void SkDebugf(const char format[], ...) {

OutputDebugStringA(buffer);
}
#endif//defined(SK_BUILD_FOR_WIN32)
#endif//defined(SK_BUILD_FOR_WIN)
4 changes: 2 additions & 2 deletions src/ports/SkFontHost_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

#include "SkTypes.h"
#if defined(SK_BUILD_FOR_WIN32)
#if defined(SK_BUILD_FOR_WIN)

#include "SkAdvancedTypefaceMetrics.h"
#include "SkBase64.h"
Expand Down Expand Up @@ -2477,4 +2477,4 @@ class SkFontMgrGDI : public SkFontMgr {

sk_sp<SkFontMgr> SkFontMgr_New_GDI() { return sk_make_sp<SkFontMgrGDI>(); }

#endif//defined(SK_BUILD_FOR_WIN32)
#endif//defined(SK_BUILD_FOR_WIN)
4 changes: 2 additions & 2 deletions src/ports/SkFontMgr_win_dw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

#include "SkTypes.h"
#if defined(SK_BUILD_FOR_WIN32)
#if defined(SK_BUILD_FOR_WIN)

#include "SkDWrite.h"
#include "SkDWriteFontFileStream.h"
Expand Down Expand Up @@ -1086,4 +1086,4 @@ SK_API sk_sp<SkFontMgr> SkFontMgr_New_DirectWriteRenderer(sk_sp<SkRemotableFontM
}
return sk_make_sp<SkFontMgr_Indirect>(std::move(impl), std::move(proxy));
}
#endif//defined(SK_BUILD_FOR_WIN32)
#endif//defined(SK_BUILD_FOR_WIN)
4 changes: 2 additions & 2 deletions src/ports/SkFontMgr_win_dw_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

#include "SkTypes.h"
#if defined(SK_BUILD_FOR_WIN32) // And !SKIA_GDI?
#if defined(SK_BUILD_FOR_WIN) // And !SKIA_GDI?

#include "SkFontMgr.h"
#include "SkTypeface_win.h"
Expand All @@ -15,4 +15,4 @@ sk_sp<SkFontMgr> SkFontMgr::Factory() {
return SkFontMgr_New_DirectWrite();
}

#endif//defined(SK_BUILD_FOR_WIN32)
#endif//defined(SK_BUILD_FOR_WIN)
4 changes: 2 additions & 2 deletions src/ports/SkImageEncoder_WIC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

#include "SkTypes.h"

#if defined(SK_BUILD_FOR_WIN32)
#if defined(SK_BUILD_FOR_WIN)

// Workaround for:
// http://connect.microsoft.com/VisualStudio/feedback/details/621653/
Expand Down Expand Up @@ -214,4 +214,4 @@ bool SkEncodeImageWithWIC(SkWStream* stream, const SkPixmap& pixmap,
return SUCCEEDED(hr);
}

#endif // defined(SK_BUILD_FOR_WIN32)
#endif // defined(SK_BUILD_FOR_WIN)
4 changes: 2 additions & 2 deletions src/ports/SkOSFile_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

#include "SkTypes.h"
#if defined(SK_BUILD_FOR_WIN32)
#if defined(SK_BUILD_FOR_WIN)

#include "SkLeanWindows.h"
#include "SkMalloc.h"
Expand Down Expand Up @@ -273,4 +273,4 @@ bool SkOSFile::Iter::next(SkString* name, bool getDir) {
return self.fHandle != (HANDLE)~0 && get_the_file(self.fHandle, name, dataPtr, getDir);
}

#endif//defined(SK_BUILD_FOR_WIN32)
#endif//defined(SK_BUILD_FOR_WIN)
4 changes: 2 additions & 2 deletions src/ports/SkOSLibrary_posix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* found in the LICENSE file.
*/
#include "SkTypes.h"
#if !defined(SK_BUILD_FOR_WIN32)
#if !defined(SK_BUILD_FOR_WIN)

#include "SkOSLibrary.h"

Expand All @@ -18,4 +18,4 @@ void* DynamicLoadLibrary(const char* libraryName) {
void* GetProcedureAddress(void* library, const char* functionName) {
return dlsym(library, functionName);
}
#endif//!defined(SK_BUILD_FOR_WIN32)
#endif//!defined(SK_BUILD_FOR_WIN)
4 changes: 2 additions & 2 deletions src/ports/SkOSLibrary_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* found in the LICENSE file.
*/
#include "SkTypes.h"
#if defined(SK_BUILD_FOR_WIN32)
#if defined(SK_BUILD_FOR_WIN)

#include "SkOSLibrary.h"
#include "SkLeanWindows.h"
Expand All @@ -18,4 +18,4 @@ void* GetProcedureAddress(void* library, const char* functionName) {
return reinterpret_cast<void*>(::GetProcAddress((HMODULE)library, functionName));
}

#endif//defined(SK_BUILD_FOR_WIN32)
#endif//defined(SK_BUILD_FOR_WIN)
4 changes: 2 additions & 2 deletions src/ports/SkRemotableFontMgr_win_dw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* found in the LICENSE file.
*/
#include "SkTypes.h"
#if defined(SK_BUILD_FOR_WIN32)
#if defined(SK_BUILD_FOR_WIN)

#include "SkDWrite.h"
#include "SkDWriteFontFileStream.h"
Expand Down Expand Up @@ -466,4 +466,4 @@ SkRemotableFontMgr* SkRemotableFontMgr_New_DirectWrite() {

return new SkRemotableFontMgr_DirectWrite(sysFontCollection.get(), localeName, localeNameLen);
}
#endif//defined(SK_BUILD_FOR_WIN32)
#endif//defined(SK_BUILD_FOR_WIN)
Loading

0 comments on commit 8f11d4d

Please sign in to comment.