Fixed build problem with SDL_string.c

Officially deprecated SDL_byteorder.h, SDL_getenv.h and SDL_types.h
Moved endian-related SDL_rwops code into SDL_rwops.c
This commit is contained in:
Sam Lantinga
2006-02-09 09:38:05 +00:00
parent 8df54cd371
commit 20c4849e7e
19 changed files with 261 additions and 256 deletions

View File

@@ -13,7 +13,6 @@ libSDLinclude_HEADERS = \
SDL_config.h \
SDL_copying.h \
SDL_cpuinfo.h \
SDL_ctype.h \
SDL_endian.h \
SDL_error.h \
SDL_events.h \
@@ -29,7 +28,7 @@ libSDLinclude_HEADERS = \
SDL_opengl.h \
SDL_quit.h \
SDL_rwops.h \
SDL_stdarg.h \
SDL_stdinc.h \
SDL_stdlib.h \
SDL_string.h \
SDL_syswm.h \

View File

@@ -20,29 +20,5 @@
slouken@libsdl.org
*/
/* Macros for determining the byte-order of this platform */
#ifndef _SDL_byteorder_h
#define _SDL_byteorder_h
#include "SDL_config.h"
/* The two types of endianness */
#define SDL_LIL_ENDIAN 1234
#define SDL_BIG_ENDIAN 4321
#ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */
#if (defined(__i386__) || defined(__i386)) || \
defined(__ia64__) || defined(__x86_64__) || \
(defined(__alpha__) || defined(__alpha)) || \
(defined(__arm__) || defined(__thumb__)) || \
(defined(__sh__) || defined(__sh64__)) || \
(defined(__mips__) && defined(__MIPSEL__)) || \
defined(__SYMBIAN32__) || defined(__OS2__)
#define SDL_BYTEORDER SDL_LIL_ENDIAN
#else
#define SDL_BYTEORDER SDL_BIG_ENDIAN
#endif
#endif /* !SDL_BYTEORDER */
#endif /* _SDL_byteorder_h */
/* DEPRECATED */
#include "SDL_endian.h"

View File

@@ -1,3 +1,4 @@
/* include/SDL_config.h. Generated by configure. */
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
@@ -23,17 +24,111 @@
#ifndef _SDL_config_h
#define _SDL_config_h
/* This is the minimal configuration that can be used to build SDL */
/* This is a set of defines to configure the SDL features */
#include <stdarg.h>
/* C language features */
/* #undef const */
/* #undef inline */
/* #undef volatile */
typedef signed char int8_t;
typedef unsigned char uint8_t;
typedef signed short int16_t;
typedef unsigned short uint16_t;
typedef signed int int32_t;
typedef unsigned int uint32_t;
typedef unsigned int size_t;
typedef unsigned long uintptr_t;
/* C datatypes */
/* #undef size_t */
/* #undef int8_t */
/* #undef uint8_t */
/* #undef int16_t */
/* #undef uint16_t */
/* #undef int32_t */
/* #undef uint32_t */
#define SDL_HAS_64BIT_TYPE 1
/* #undef int64_t */
/* #undef uint64_t */
/* #undef uintptr_t */
/* Endianness */
#define SDL_BYTEORDER 1234
/* Comment this if you want to build without any C library requirements */
#define HAVE_LIBC 1
#ifdef HAVE_LIBC
/* Useful headers */
#define HAVE_SYS_TYPES_H 1
#define HAVE_STDIO_H 1
#define STDC_HEADERS 1
#define HAVE_STDLIB_H 1
#define HAVE_STDARG_H 1
#define HAVE_MALLOC_H 1
#define HAVE_MEMORY_H 1
#define HAVE_STRING_H 1
#define HAVE_STRINGS_H 1
#define HAVE_INTTYPES_H 1
#define HAVE_STDINT_H 1
#define HAVE_CTYPE_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_ALLOCA 1
#ifndef _WIN32 /* Don't use C runtime versions of these on Windows */
#define HAVE_GETENV 1
#define HAVE_PUTENV 1
#define HAVE_UNSETENV 1
#endif
#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_STRCPY 1
#define HAVE_STRNCPY 1
#define HAVE_STRCAT 1
#define HAVE_STRNCAT 1
#define HAVE_STRDUP 1
/* #undef HAVE__STRREV */
/* #undef HAVE__STRUPR */
/* #undef HAVE__STRLWR */
/* #undef HAVE_INDEX */
/* #undef HAVE_RINDEX */
#define HAVE_STRCHR 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
/* #undef HAVE_ITOA */
/* #undef HAVE__LTOA */
/* #undef HAVE__UITOA */
/* #undef HAVE__ULTOA */
#define HAVE_STRTOL 1
/* #undef HAVE__I64TOA */
/* #undef HAVE__UI64TOA */
#define HAVE_STRTOLL 1
#define HAVE_STRTOD 1
#define HAVE_ATOI 1
#define HAVE_ATOF 1
#define HAVE_STRCMP 1
#define HAVE_STRNCMP 1
/* #undef HAVE_STRICMP */
#define HAVE_STRCASECMP 1
#define HAVE_SSCANF 1
#define HAVE_SNPRINTF 1
/* #undef HAVE_VSNPRINTF */
#endif /* HAVE_LIBC */
/* Allow disabling of core subsystems */
/* #undef DISABLE_AUDIO */
/* #undef DISABLE_VIDEO */
/* #undef DISABLE_EVENTS */
/* #undef DISABLE_JOYSTICK */
/* #undef DISABLE_CDROM */
/* #undef DISABLE_THREADS */
/* #undef DISABLE_TIMERS */
/* #undef DISABLE_FILE */
/* #undef DISABLE_CPUINFO */
#endif /* _SDL_config_h */

View File

@@ -43,6 +43,9 @@
#undef uint64_t
#undef uintptr_t
/* Endianness */
#undef SDL_BYTEORDER
/* Comment this if you want to build without any C library requirements */
#undef HAVE_LIBC
#ifdef HAVE_LIBC
@@ -124,7 +127,6 @@
#undef DISABLE_CDROM
#undef DISABLE_THREADS
#undef DISABLE_TIMERS
#undef DISABLE_ENDIAN
#undef DISABLE_FILE
#undef DISABLE_CPUINFO

View File

@@ -25,22 +25,26 @@
#ifndef _SDL_endian_h
#define _SDL_endian_h
/* These functions read and write data of the specified endianness,
dynamically translating to the host machine endianness.
#include "SDL_stdinc.h"
e.g.: If you want to read a 16 bit value on big-endian machine from
an open file containing little endian values, you would use:
value = SDL_ReadLE16(rp);
Note that the read/write functions use SDL_RWops pointers
instead of FILE pointers. This allows you to read and write
endian values from large chunks of memory as well as files
and other data sources.
*/
/* The two types of endianness */
#define SDL_LIL_ENDIAN 1234
#define SDL_BIG_ENDIAN 4321
#ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */
#if (defined(__i386__) || defined(__i386)) || \
defined(__ia64__) || defined(__x86_64__) || \
(defined(__alpha__) || defined(__alpha)) || \
(defined(__arm__) || defined(__thumb__)) || \
(defined(__sh__) || defined(__sh64__)) || \
(defined(__mips__) && defined(__MIPSEL__)) || \
defined(__SYMBIAN32__) || defined(__OS2__)
#define SDL_BYTEORDER SDL_LIL_ENDIAN
#else
#define SDL_BYTEORDER SDL_BIG_ENDIAN
#endif
#endif /* !SDL_BYTEORDER */
#include "SDL_types.h"
//#warning FIXME: move rwops into rwops and swapping into byteorder.h
#include "SDL_rwops.h"
#include "SDL_byteorder.h"
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
@@ -180,23 +184,6 @@ static __inline__ Uint64 SDL_Swap64(Uint64 x)
#define SDL_SwapBE64(X) (X)
#endif
/* Read an item of the specified endianness and return in native format */
extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops *src);
extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops *src);
extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(SDL_RWops *src);
extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops *src);
extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops *src);
extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops *src);
/* Write an item of native format to the specified endianness */
extern DECLSPEC int SDLCALL SDL_WriteLE16(SDL_RWops *dst, Uint16 value);
extern DECLSPEC int SDLCALL SDL_WriteBE16(SDL_RWops *dst, Uint16 value);
extern DECLSPEC int SDLCALL SDL_WriteLE32(SDL_RWops *dst, Uint32 value);
extern DECLSPEC int SDLCALL SDL_WriteBE32(SDL_RWops *dst, Uint32 value);
extern DECLSPEC int SDLCALL SDL_WriteLE64(SDL_RWops *dst, Uint64 value);
extern DECLSPEC int SDLCALL SDL_WriteBE64(SDL_RWops *dst, Uint64 value);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}

View File

@@ -20,4 +20,5 @@
slouken@libsdl.org
*/
/* DEPRECATED */
#include "SDL_stdinc.h"

View File

@@ -27,14 +27,9 @@
#ifndef _SDL_RWops_h
#define _SDL_RWops_h
#include "SDL_config.h"
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
#include "SDL_types.h"
#include "SDL_stdinc.h"
#ifndef DISABLE_FILE
#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
@@ -112,10 +107,28 @@ extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops *area);
#define SDL_RWclose(ctx) (ctx)->close(ctx)
/* Read an item of the specified endianness and return in native format */
extern DECLSPEC Uint16 SDLCALL SDL_ReadLE16(SDL_RWops *src);
extern DECLSPEC Uint16 SDLCALL SDL_ReadBE16(SDL_RWops *src);
extern DECLSPEC Uint32 SDLCALL SDL_ReadLE32(SDL_RWops *src);
extern DECLSPEC Uint32 SDLCALL SDL_ReadBE32(SDL_RWops *src);
extern DECLSPEC Uint64 SDLCALL SDL_ReadLE64(SDL_RWops *src);
extern DECLSPEC Uint64 SDLCALL SDL_ReadBE64(SDL_RWops *src);
/* Write an item of native format to the specified endianness */
extern DECLSPEC int SDLCALL SDL_WriteLE16(SDL_RWops *dst, Uint16 value);
extern DECLSPEC int SDLCALL SDL_WriteBE16(SDL_RWops *dst, Uint16 value);
extern DECLSPEC int SDLCALL SDL_WriteLE32(SDL_RWops *dst, Uint32 value);
extern DECLSPEC int SDLCALL SDL_WriteBE32(SDL_RWops *dst, Uint32 value);
extern DECLSPEC int SDLCALL SDL_WriteLE64(SDL_RWops *dst, Uint64 value);
extern DECLSPEC int SDLCALL SDL_WriteBE64(SDL_RWops *dst, Uint64 value);
/* Ends C function definitions when using C++ */
#ifdef __cplusplus
}
#endif
#include "close_code.h"
#endif /* !DISABLE_FILE */
#endif /* _SDL_RWops_h */

View File

@@ -20,4 +20,5 @@
slouken@libsdl.org
*/
/* DEPRECATED */
#include "SDL_stdinc.h"