/*
    SDL - Simple DirectMedia Layer
    Copyright (C) 1997-2006 Sam Lantinga

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA

    Sam Lantinga
    slouken@libsdl.org

    patched by
    Alex Chupahin elvis_75@mail.ru
    Rostov-on-Don, Russia
*/

#ifndef _SDL_config_vms_h
#define _SDL_config_vms_h

/* DO NOT REMOVE THIS PRAGMA, and do not "balance" it with a #pragma pack()
   at the end of this file, however wrong it looks.  It is load-bearing.

   LIBSDL$SHR is a PREBUILT shared library, and every one of its own sources
   starts with #include "SDL_config.h" (src/SDL.c:22, src/video/SDL_video.c:22,
   ...) - so the library itself was compiled with pack(1) in force and its
   SDL_Surface / SDL_PixelFormat are byte-packed on disk.  Measured, packed vs
   naturally aligned:

       sizeof(SDL_Surface)      74   vs  88     ->pitch  at 20 vs 24
                                               ->pixels at 22 vs 32
       sizeof(SDL_PixelFormat)  39   vs  48

   Note that begin_code.h's #pragma pack(push,4) does NOT protect the public
   structs here: that block is guarded by _MSC_VER / __MWERKS__ / __BORLANDC__
   only, and DEC C is none of them (begin_code.h mentions __DECC solely for
   __inline, at line 115).  So on this compiler this pragma is the ONLY thing
   setting SDL's struct layout, and an application that drops it reads
   ->pixels and ->pitch from the wrong offsets entirely - which on an 8bpp
   paletted game means drawing into arbitrary memory.

   THE REAL HAZARD IS THE LEAK, NOT THE PACKING.  The pragma is unbalanced, and
   SDL_stdinc.h includes this file, so #include "SDL.h" leaves the rest of the
   translation unit byte-packed - including the application's OWN structs
   declared long afterwards.  If some of an application's files include SDL.h
   and others do not, the two groups disagree about the layout of shared
   structures, silently: it compiles, it links, and it corrupts.

   That is not hypothetical.  See [-.ROTT]COMPILER_FIXES.TXT section 15 for a
   worked case: lumpy.h's cfont_t ("byte color; short height; char width[256];
   short charofs[256];") lands charofs at 259 packed and 260 aligned, RT_MENU.C
   includes SDL.h while RT_STR.C does not, and the main menu drew its text from
   one-byte-shifted glyph offsets.

   The fix belongs in the APPLICATION, not here - either include SDL.h from a
   single translation unit, or make the include consistent across every file
   that shares a struct.  Changing this file would require rebuilding LIBSDL$SHR
   from source with the same setting, which is not what a game port should be
   doing.  */

#pragma pack (1)

#include "SDL_platform.h"

/* This is a set of defines to configure the SDL features */

#define HAVE_SYS_TYPES_H        1
#define HAVE_STDIO_H    1
#define STDC_HEADERS    1
#define HAVE_STRING_H   1
#define HAVE_INTTYPES_H 1
#define HAVE_CTYPE_H    1
#define HAVE_MATH_H     1
#define HAVE_SIGNAL_H   1

/* C library functions */
#define HAVE_MALLOC     1
#define HAVE_CALLOC     1
#define HAVE_REALLOC    1
#define HAVE_FREE       1
#define HAVE_GETENV     1
#define HAVE_PUTENV     1
#define HAVE_UNSETENV   1
#define HAVE_QSORT      1
#define HAVE_ABS        1
#define HAVE_BCOPY      1
#define HAVE_MEMSET     1
#define HAVE_MEMCPY     1
#define HAVE_MEMMOVE    1
#define HAVE_MEMCMP     1
#define HAVE_STRLEN     1
#define HAVE_STRDUP     1
#define HAVE_STRCHR     1
#define HAVE_STRRCHR    1
#define HAVE_STRSTR     1
#define HAVE_STRTOL     1
#define HAVE_STRTOUL    1
#define HAVE_STRTOLL    1
#define HAVE_STRTOULL   1
#define HAVE_STRTOD     1
#define HAVE_ATOI       1
#define HAVE_ATOF       1
#define HAVE_STRCMP     1
#define HAVE_STRNCMP    1
#define HAVE_STRCASECMP 1
#define HAVE_STRNCASECMP 1
#define HAVE_SSCANF     1
#define HAVE_SIGACTION  1
#define HAVE_SETJMP     1


/* Enable various cdrom drivers */
#define SDL_CDROM_VMS   1

/* Enable various input drivers */
#define SDL_JOYSTICK_DUMMY      1

#define RTLD_GLOBAL 0
#define SDL_LOADSO_DLOPEN     1
//#define SDL_LOADSO_DISABLED     1

#define SDL_THREAD_PTHREAD    1
 #define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX    1
/* Enable various threading systems */
//#define SDL_THREAD_PTHREAD    1
//#define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX    1

/* Enable various timer systems */
#define SDL_TIMER_UNIX  1

#define SDL_VIDEO_DRIVER_X11 1

/* Enable various video drivers */
//#define SDL_VIDEO_DRIVER_DUMMY        1


#define SDL_memset4 memset
	#define SDL_HAS_64BIT_TYPE 1
	#define HAVE_GETENV 1
	#define HAVE_NANOSLEEP 1
	#define HAVE_SNPRINTF 1
	#define HAVE_VSNPRINTF 1
	#define SDL_AUDIO_DRIVER_MMEAUDIO 1
	#define SDL_AUDIO_DISABLED      0
 #endif
