// stdafx.h : include file for standard system include files,
//  or project specific include files that are used frequently, but
//      are changed infrequently
//


#if !defined(AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)
#define AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#define WIN32_LEAN_AND_MEAN		// Exclude rarely-used stuff from Windows headers


#define SEQUENCED_TIMERS

// Windows Header Files:
#if defined _MSVC_INTEL || defined _MSVC_CE2002ARM
#include <windows.h>
#pragma warning (disable:4996) // sprintf, etc deprecated
#endif

// C RunTime Header Files
#if defined _MSVC_INTEL || defined _MSVC_CE2002ARM
#include <stdlib.h>
#include <memory.h>
#include <tchar.h>
#else
#ifdef _LINUX
#  ifdef __VMS
/* ==========================================================================
 * OpenVMS.  Two differences from the Linux prologue, and the ORDER matters.
 *
 * 1. EVERY SYSTEM HEADER THE BUILD USES IS INCLUDED HERE, BEFORE <SDL.h>.
 *
 *    This is not tidiness.  The OpenVMS SDL 1.2 distribution's SDL_config.h
 *    opens with an UNBALANCED "#pragma pack (1)" (see the DO-NOT-REMOVE
 *    comment at the top of LIBSDL:[include]SDL_config.h, and section 15 of
 *    [-.ROTT]COMPILER_FIXES.TXT).  It has to be there - LIBSDL$SHR is a
 *    prebuilt shared library whose own sources were compiled with it, so its
 *    SDL_Surface really is byte-packed (74 bytes, ->pixels at offset 22) and
 *    an application that resets the packing reads ->pixels and ->pitch from
 *    the wrong offsets.  begin_code.h does not save you either: its
 *    "#pragma pack(push,4)" is guarded by _MSC_VER/__MWERKS__/__BORLANDC__
 *    and DEC C++ is none of those.
 *
 *    The consequence is that #include <SDL.h> leaves the REST of the
 *    translation unit byte-packed.  For this engine that is harmless where
 *    its own structures are concerned - CSBTypes.h asks for byte packing on
 *    the very next line anyway, deliberately, because the structures are
 *    overlays on little-endian Atari ST disk images - and all 41 sources in
 *    the build get the same treatment, so there is no possibility of two
 *    objects disagreeing about a shared layout (the trap that corrupted
 *    ROTT's fonts).
 *
 *    What is NOT harmless is a SYSTEM header being read with packing in
 *    force: struct stat, struct timeval and FILE are laid out by the C RTL,
 *    which was compiled naturally aligned, and stat()/gettimeofday()/getc()
 *    would then read and write the wrong offsets of a struct the RTL owns.
 *    The DEC C headers do defend themselves against this (they bracket their
 *    declarations in #pragma __member_alignment __save/__restore), which is
 *    why the sibling ports survive even a global /NOMEMBER_ALIGNMENT - but
 *    depending on that is depending on an implementation detail of someone
 *    else's header, for no gain.  Including them first costs two dozen lines
 *    and makes the question moot.  Include guards make the per-file
 *    #include <unistd.h> / <sys/time.h> / <signal.h> / <fcntl.h> / <ctype.h>
 *    in LinCSBUI.cpp and friends no-ops.
 *
 * 2. THERE IS NO GLib AND NO <memory.h>.  memcpy/memset live in <string.h>,
 *    and vmsglib.h supplies the GLib typedefs, G_BYTE_ORDER, the
 *    integer<->pointer casts and the logging entry points that the
 *    _LINUX-flavoured sources use - read its header comment for the full
 *    inventory and the reasoning.  GTK is never available, so USE_OLD_GTK
 *    must stay undefined: the OpenVMS UI is the SDL window and nothing else.
 * ========================================================================== */
#    include <stdlib.h>
#    include <stdio.h>
#    include <string.h>
#    include <time.h>
#    include <ctype.h>
#    include <unistd.h>
#    include <fcntl.h>
#    include <signal.h>
#    include <sys/types.h>
#    include <sys/stat.h>
#    include <sys/time.h>
#    include <SDL.h>
#    include "vmsglib.h"
#  else
#    include <SDL.h>
#    include <stdlib.h>
#    include <stdio.h>
#    include <memory.h>
#    include <glib.h>
#    include <sys/stat.h>
#  endif
#  ifdef USE_OLD_GTK
#    ifdef __VMS
#      error USE_OLD_GTK is not supported on OpenVMS - there is no GTK 2
#    endif
#    include <gtk/gtk.h>
#  endif
# else
#  include <stdlib.h>
#  include <stdio.h>
#  include "Transition.h"
# endif
#endif

// Local Header Files

// TODO: reference additional headers your program requires here

#include "Objects.h"
#include "CSBTypes.h"

#ifdef _MSVC_INTEL
#pragma warning(disable:4710)
#endif

#ifdef _MSVC_CE2002ARM
void ec(void);
#define EC ec();
#define CEtry _try {
#define CEexception(n) } _except(per=GetExceptionInformation(),CaptureExceptionInfo(), 1){PrintExceptionInfo();PostQuitMessage(1); };
#else
#define EC
#define CEtry
#define CEexception(n)
#endif

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_STDAFX_H__A9DB83DB_A9FD_11D0_BFD1_444553540000__INCLUDED_)

