From 44ae99a0758543d8156b2dadd822d3d79ef52cf2 Mon Sep 17 00:00:00 2001 From: ehouse Date: Sat, 22 Nov 2008 16:43:55 +0000 Subject: [PATCH] remove redundant set of #defines for whether we're compiling for desktop or wince --- xwords4/wince/Makefile | 2 -- xwords4/wince/cedict.c | 2 +- xwords4/wince/cedraw.c | 2 +- xwords4/wince/cemain.c | 20 ++++++++++---------- xwords4/wince/cemain.h | 5 +---- xwords4/wince/xptypes.h | 13 +++---------- 6 files changed, 16 insertions(+), 28 deletions(-) diff --git a/xwords4/wince/Makefile b/xwords4/wince/Makefile index 7be817501..8c2e6b7fb 100644 --- a/xwords4/wince/Makefile +++ b/xwords4/wince/Makefile @@ -57,7 +57,6 @@ CELIBS = -L/usr/arm-wince-pe/lib else CELIBS = -L${CEOPT_ROOT}/${CE_ARCH}/lib/ -lws2 endif -TARGET_OS_DEF = -DTARGET_OS_WINCE STANDALONE = -DXWFEATURE_STANDALONE_ONLY COLOR_SEL = -DMY_COLOR_SEL CFLAGS += -D_WIN32_WCE=0x0400 -D_WIN32_IE=0x0400 -DUNDER_CE \ @@ -81,7 +80,6 @@ STANDALONE = -DXWFEATURE_STANDALONE_ONLY CC = i586-mingw32msvc-gcc WINDRES = i586-mingw32msvc-windres STRIP = i586-mingw32msvc-strip -TARGET_OS_DEF = -DTARGET_OS_WIN32 CELIBS += -lws2_32 CFLAGS += -DCANT_DO_CMDBAR -DDRAW_LINK_DIRECT -DXWFEATURE_TURNCHANGENOTIFY diff --git a/xwords4/wince/cedict.c b/xwords4/wince/cedict.c index 5eaf60814..05ad1f110 100755 --- a/xwords4/wince/cedict.c +++ b/xwords4/wince/cedict.c @@ -467,7 +467,7 @@ openMappedFile( MPFORMAL const wchar_t* name, HANDLE* mappedFileP, } } } -#elif defined TARGET_OS_WIN32 +#else hFile = CreateFile( name, GENERIC_READ, FILE_SHARE_READ, diff --git a/xwords4/wince/cedraw.c b/xwords4/wince/cedraw.c index 167a4f1b6..908225214 100755 --- a/xwords4/wince/cedraw.c +++ b/xwords4/wince/cedraw.c @@ -902,7 +902,7 @@ DRAW_FUNC_NAME(drawCell)( DrawCtx* p_dctx, const XP_Rect* xprect, widebuf, VSIZE(widebuf) ); SetTextColor( hdc, dctx->globals->appPrefs.colors[foreColorIndx] ); -#ifdef TARGET_OS_WIN32 +#ifndef _WIN32_WCE MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED, letters, -1, widebuf, VSIZE(widebuf) ); #endif diff --git a/xwords4/wince/cemain.c b/xwords4/wince/cemain.c index d6e74c754..0f4649682 100755 --- a/xwords4/wince/cemain.c +++ b/xwords4/wince/cemain.c @@ -227,10 +227,10 @@ LRESULT CALLBACK ceAbout (HWND, UINT, WPARAM, LPARAM); int WINAPI WinMain( HINSTANCE hInstance, HINSTANCE XP_UNUSED(hPrevInstance), -#if defined TARGET_OS_WINCE - LPWSTR XP_UNUSED_CE(lpCmdLine), -#elif defined TARGET_OS_WIN32 - LPSTR XP_UNUSED_DBG(lpCmdLine), +#ifdef _WIN32_WCE + LPWSTR XP_UNUSED_CE(lpCmdLine), +#else + LPSTR lpCmdLine, #endif int nCmdShow) { @@ -275,9 +275,9 @@ main() LOG_FUNC(); return WinMain( GetModuleHandle(NULL), 0, -#if defined TARGET_OS_WINCE +#ifdef _WIN32_WCE GetCommandLineW(), -#elif defined TARGET_OS_WIN32 +#else GetCommandLineA(), #endif SW_SHOWDEFAULT ); @@ -308,7 +308,7 @@ MyRegisterClass(HINSTANCE hInstance, LPTSTR szWindowClass) wc.hInstance = hInstance; wc.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_XWORDS4)); wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH); -#if defined TARGET_OS_WIN32 +#ifndef _WIN32_WCE wc.lpszMenuName = (LPCTSTR)IDM_MENU; #endif wc.lpszClassName = szWindowClass; @@ -1340,7 +1340,7 @@ InitInstance(HINSTANCE hInstance, int nCmdShow } #endif -#ifdef TARGET_OS_WIN32 +#ifndef _WIN32_WCE srand( time(NULL) ); #endif @@ -2777,9 +2777,9 @@ wince_debugf(const XP_UCHAR* format, ...) #endif makeTimeStamp(timeStamp, sizeof(timeStamp)); -#if defined TARGET_OS_WINCE +#ifdef _WIN32_WCE logFileName = L"\\My Documents\\" LCROSSWORDS_DIR L"\\xwDbgLog.txt"; -#elif defined TARGET_OS_WIN32 +#else logFileName = L"xwDbgLog.txt"; #endif fileH = CreateFile( logFileName, diff --git a/xwords4/wince/cemain.h b/xwords4/wince/cemain.h index 088a4c589..9f4d40748 100755 --- a/xwords4/wince/cemain.h +++ b/xwords4/wince/cemain.h @@ -114,11 +114,8 @@ typedef struct CEAppGlobals { HINSTANCE hInst; HDC hdc; /* to pass drawing ctxt to draw code */ HWND hWnd; -#if defined TARGET_OS_WINCE - HWND hwndCB; -#endif - #ifdef _WIN32_WCE + HWND hwndCB; SHACTIVATEINFO sai; XW_WinceVersion winceVersion; #else diff --git a/xwords4/wince/xptypes.h b/xwords4/wince/xptypes.h index d798cbf80..3bf17bdb2 100755 --- a/xwords4/wince/xptypes.h +++ b/xwords4/wince/xptypes.h @@ -1,6 +1,6 @@ /* -*-mode: C; fill-column: 78; c-basic-offset: 4; -*- */ /* - * Copyright 1999-2000 by Eric House (xwords@eehouse.org). All rights reserved. + * Copyright 1999-2008 by Eric House (xwords@eehouse.org). All rights reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -27,13 +27,6 @@ #include #include -/* #include */ -/* #include */ -/* #include */ -/* #include */ -/* #include */ -/* #include */ - typedef unsigned char XP_U8; typedef signed char XP_S8; @@ -54,9 +47,9 @@ typedef XP_U32 XP_Time; #define XP_CR "\015\012" /* 'Doze expects a carraige return followed by a linefeed */ -#if defined TARGET_OS_WINCE +#ifdef _WIN32_WCE # define XP_RANDOM() Random() -#elif defined TARGET_OS_WIN32 +#else # define XP_RANDOM() rand() #endif