giguere@csg.waterloo.edu (Eric Giguere) (01/26/91)
1) Put in something similar to: #ifndef WINDOWS_H_INCLUDED #define WINDOWS_H_INCLUDED blah blah blah #endif /* WINDOWS_H_INCLUDED */ Right now I kludge it by testing for the PASCAL macro. 2) Replace the line: WORD NEAR * PASCAL pLocalHeap; with the proper ANSI form: extern WORD NEAR * PASCAL pLocalHeap; since ANSI compliant compilers define storage for the first. Or at least put in something like this: #if defined ( _MSC_VER ) /* Microsoft C */ WORD NEAR * PASCAL pLocalHeap; #else /* Watcom C */ extern WORD NEAR * PASCAL pLocalHeap; #endif 3) Make it smaller/split it up. Probably a pipe dream here. Anything else we should all be aware about...? -- Eric Giguere giguere@csg.UWaterloo.CA Quoth the raven: "Eat my shorts!" --- Poe & Groening
johnm@spudge.UUCP (John Munsch) (01/31/91)
In article <1991Jan26.010935.4400@maytag.waterloo.edu> giguere@csg.waterloo.edu (Eric Giguere) writes: >1) Put in something similar to: > > #ifndef WINDOWS_H_INCLUDED > #define WINDOWS_H_INCLUDED > > blah blah blah > > #endif /* WINDOWS_H_INCLUDED */ > > Right now I kludge it by testing for the PASCAL macro. Agreed, and they also need #ifdef __cplusplus extern "Pascal" { #endif blah blah blah #ifdef __cplusplus } #endif for compatability with C++ compilers. >3) Make it smaller/split it up. Probably a pipe dream here. No need to make it smaller or split it up. Instead try NEW IMPROVED inhibit.h. // inhibit.h // tab_size: 4 // Inhibit sections of WINDOWS.H #define NOGDICAPMASKS // CC_*, LC_*, PC_*, CP_*, TC_*, RC_ #define NOVIRTUALKEYCODES // VK_* #define NOWINMESSAGES // WM_*, EM_*, LB_*, CB_* #define NOWINSTYLES // WS_*, CS_*, ES_*, LBS_*, SBS_*, CBS_* #define NOSYSMETRICS // SM_* #define NOMENUS // MF_* #define NOICONS // IDI_* #define NOKEYSTATES // MK_* #define NOSYSCOMMANDS // SC_* #define NORASTEROPS // Binary and Tertiary raster ops #define NOSHOWWINDOW // SW_* #define OEMRESOURCE // OEM Resource values #define NOATOM // Atom Manager routines #define NOCLIPBOARD // Clipboard routines #define NOCOLOR // Screen colors #define NOCTLMGR // Control and Dialog routines #define NODRAWTEXT // DrawText() and DT_* #define NOGDI // All GDI defines and routines #define NOKERNEL // All KERNEL defines and routines #define NOUSER // All USER defines and routines #define NOMB // MB_* and MessageBox() #define NOMEMMGR // GMEM_*, LMEM_*, GHND, LHND, associated routines #define NOMETAFILE // typedef METAFILEPICT #define NOMINMAX // Macros min(a,b) and max(a,b) #define NOMSG // typedef MSG and associated routines #define NOOPENFILE // OpenFile(), OemToAnsi, AnsiToOem, and OF_* #define NOSCROLL // SB_* and scrolling routines #define NOSOUND // Sound driver routines #define NOTEXTMETRIC // typedef TEXTMETRIC and associated routines #define NOWH // SetWindowsHook and WH_* #define NOWINOFFSETS // GWL_*, GCL_*, associated routines #define NOCOMM // COMM driver routines #define NOKANJI // Kanji support stuff. #define NOHELP // Help engine interface. #define NOPROFILER // Profiler interface. #define NODEFERWINDOWPOS // DeferWindowPos routines Including this file ahead of windows.h will inhibit virtually everything initially, but experience will tell you the handful of #defines that you need to comment out. Most of my apps only have 5 or 6 sections of windows.h used and as a result they now compile even FASTER! Yay! John Munsch