views:

291

answers:

3

I was browsing through Windows's Platform SDK header files (what a life, right?), and I noticed many places contained references to the preprocessor symbol _MAC. For example:

// WinUser.h line 1568
/*
 * Message structure
 */
typedef struct tagMSG {
    HWND        hwnd;
    UINT        message;
    WPARAM      wParam;
    LPARAM      lParam;
    DWORD       time;
    POINT       pt;
#ifdef _MAC
    DWORD       lPrivate;
#endif
} MSG, *PMSG, NEAR *NPMSG, FAR *LPMSG;

Does this mean "Macintosh", as it appears? Was there a time where Windows or a subset of Windows could be compiled for the Macintosh?

+1  A: 

I assume it is/was used for compiling Microsoft software (Office, IE, Windows Media Player) for MacOS. I know that IE and WMP for Solaris included a subset of Windows itself (e.g. libwinnt.so, libkernel32.so) as a direct replacement for the corresponding Windows DLLs.

jarnbjo
Kind of similar to how when looking at iTunes for Windows, you see a bunch of `.plist` files and something called `Foundation.framework` or similar, IIRC.
asveikau
jarnbjo
@jarnbjo Actually, for these ObjC libraries this predates Mac OS X substantially. IIRC, NeXT had Foundation/AppKit running under NT in the 90s.
asveikau
A: 

Lots of MS code has references to MAC as they develop for mac as well - for example office. Probably this bit of the header file came from those teams.

Preet Sangha
Office* not OFFICE. (I'm looking at you, people who put JAVA on their resumes...)
Mike Atlas
just edit the answer damit :-)
Preet Sangha
+5  A: 

At one time Microsoft was the largest developer of Macintosh software in the world. Excel and Word dominated their respective markets on the Macintosh, and later so did Office. So it's not that surprising that the applications division at MS would want a subset of the Windows header files that worked on the MAC - to make their cross platform software easier to maintain.

But there was never any version of the Windows OS that ran on the Macintosh.

In any case, this fragment is from objidl.h, seems to indicate that _MAC does indeed mean Macintosh in the header files though...

//FSSpec is Macintosh only, defined in macos\files.h
#ifdef _MAC
    typedef struct tagSTATSTG
    {                      
        LPOLESTR pwcsName;
            FSSpec *pspec;
        DWORD type;
        ULARGE_INTEGER cbSize;
...
    } STATSTG;
#else //_MAC
John Knoeller