Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
SDL 1.3 requires a 64-bit type for the platform.
  • Loading branch information
slouken committed Mar 25, 2011
1 parent b7eff43 commit a3d76f6
Show file tree
Hide file tree
Showing 16 changed files with 5 additions and 2,350 deletions.
2,179 changes: 0 additions & 2,179 deletions configure

Large diffs are not rendered by default.

49 changes: 0 additions & 49 deletions configure.in
Expand Up @@ -198,13 +198,6 @@ if test x$enable_libc = xyes; then

dnl Check for typedefs, structures, etc.
AC_TYPE_SIZE_T
if test x$ac_cv_header_inttypes_h = xyes -o x$ac_cv_header_stdint_h = xyes; then
AC_CHECK_TYPE(int64_t)
if test x$ac_cv_type_int64_t = xyes; then
AC_DEFINE(SDL_HAS_64BIT_TYPE)
fi
have_inttypes=yes
fi

dnl Check for defines
AC_CHECK_DEFINE(M_PI, math.h)
Expand Down Expand Up @@ -245,48 +238,6 @@ if test x$enable_libc = xyes; then
fi

AC_CHECK_SIZEOF(void*)
if test x$have_inttypes != xyes; then
AC_CHECK_SIZEOF(char, 1)
AC_CHECK_SIZEOF(short, 2)
AC_CHECK_SIZEOF(int, 4)
AC_CHECK_SIZEOF(long, 4)
AC_CHECK_SIZEOF(long long, 8)
if test x$ac_cv_sizeof_char = x1; then
AC_DEFINE(int8_t, signed char)
AC_DEFINE(uint8_t, unsigned char)
fi
if test x$ac_cv_sizeof_short = x2; then
AC_DEFINE(int16_t, signed short)
AC_DEFINE(uint16_t, unsigned short)
else
if test x$ac_cv_sizeof_int = x2; then
AC_DEFINE(int16_t, signed int)
AC_DEFINE(uint16_t, unsigned int)
fi
fi
if test x$ac_cv_sizeof_int = x4; then
AC_DEFINE(int32_t, signed int)
AC_DEFINE(uint32_t, unsigned int)
else
if test x$ac_cv_sizeof_long = x4; then
AC_DEFINE(int32_t, signed long)
AC_DEFINE(uint32_t, unsigned long)
fi
fi
if test x$ac_cv_sizeof_long = x8; then
AC_DEFINE(int64_t, signed long)
AC_DEFINE(uint64_t, unsigned long)
AC_DEFINE(SDL_HAS_64BIT_TYPE)
else
if test x$ac_cv_sizeof_long_long = x8; then
AC_DEFINE(int64_t, signed long long)
AC_DEFINE(uint64_t, unsigned long long)
AC_DEFINE(SDL_HAS_64BIT_TYPE)
fi
fi
AC_DEFINE(size_t, unsigned int)
AC_DEFINE(uintptr_t, unsigned long)
fi

dnl See whether we can use gcc atomic operations on this architecture
AC_ARG_ENABLE(gcc-atomics,
Expand Down
14 changes: 0 additions & 14 deletions include/SDL_config.h.in
Expand Up @@ -43,21 +43,7 @@
#undef volatile

/* C datatypes */
#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
#undef size_t
#undef int8_t
#undef uint8_t
#undef int16_t
#undef uint16_t
#undef int32_t
#undef uint32_t
#undef int64_t
#undef uint64_t
#undef uintptr_t
#endif /* !_STDINT_H_ && !HAVE_STDINT_H */

#undef SIZEOF_VOIDP
#undef SDL_HAS_64BIT_TYPE
#undef HAVE_GCC_ATOMICS
#undef HAVE_GCC_SYNC_LOCK_TEST_AND_SET

Expand Down
13 changes: 0 additions & 13 deletions include/SDL_config_android.h
Expand Up @@ -33,16 +33,6 @@

#include <stdarg.h>

/*
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;
*/


#define HAVE_ALLOCA_H 1
#define HAVE_SYS_TYPES_H 1
#define HAVE_STDIO_H 1
Expand Down Expand Up @@ -115,9 +105,6 @@ typedef unsigned int uint32_t;

#define SIZEOF_VOIDP 4

typedef unsigned int size_t;
//typedef unsigned long uintptr_t;

/* Enable various audio drivers */
#define SDL_AUDIO_DRIVER_ANDROID 1
#define SDL_AUDIO_DRIVER_DUMMY 1
Expand Down
12 changes: 0 additions & 12 deletions include/SDL_config_iphoneos.h
Expand Up @@ -25,24 +25,12 @@

#include "SDL_platform.h"

#if !defined(_STDINT_H_) && (!defined(HAVE_STDINT_H) || !_HAVE_STDINT_H)
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 long uintptr_t;
#endif /* !_STDINT_H_ && !HAVE_STDINT_H */

#ifdef __LP64__
#define SIZEOF_VOIDP 8
#else
#define SIZEOF_VOIDP 4
#endif

#define SDL_HAS_64BIT_TYPE 1

#define HAVE_GCC_ATOMICS 1

#define HAVE_ALLOCA_H 1
Expand Down
2 changes: 0 additions & 2 deletions include/SDL_config_macosx.h
Expand Up @@ -36,8 +36,6 @@
#define SIZEOF_VOIDP 4
#endif

#define SDL_HAS_64BIT_TYPE 1

/* Useful headers */
/* If we specified an SDK or have a post-PowerPC chip, then alloca.h exists. */
#if ( (MAC_OS_X_VERSION_MIN_REQUIRED >= 1030) || (!defined(__POWERPC__)) )
Expand Down
1 change: 0 additions & 1 deletion include/SDL_config_minimal.h
Expand Up @@ -47,7 +47,6 @@ typedef unsigned long long uint64_t;
typedef unsigned long uintptr_t;
#endif /* !_STDINT_H_ && !HAVE_STDINT_H */

#define SDL_HAS_64BIT_TYPE
#ifdef __GNUC__
#define HAVE_GCC_SYNC_LOCK_TEST_AND_SET 1
#endif
Expand Down
2 changes: 0 additions & 2 deletions include/SDL_config_nintendods.h
Expand Up @@ -48,8 +48,6 @@ typedef unsigned __PTRDIFF_TYPE__ uintptr_t;

#define SIZEOF_VOIDP 4

#define SDL_HAS_64BIT_TYPE 1

/* Useful headers */
#define HAVE_SYS_TYPES_H 1
#define HAVE_STDIO_H 1
Expand Down
1 change: 0 additions & 1 deletion include/SDL_config_pandora.h
Expand Up @@ -34,7 +34,6 @@
#define SIZEOF_VOIDP 4
#endif

#define SDL_HAS_64BIT_TYPE 1
#define SDL_BYTEORDER 1234

#define HAVE_ALLOCA_H 1
Expand Down
1 change: 0 additions & 1 deletion include/SDL_config_windows.h
Expand Up @@ -76,7 +76,6 @@ typedef unsigned int uintptr_t;
#else
# define SIZEOF_VOIDP 4
#endif
#define SDL_HAS_64BIT_TYPE 1

/* Enabled for SDL 1.2 (binary compatibility) */
//#define HAVE_LIBC 1
Expand Down
6 changes: 0 additions & 6 deletions include/SDL_config_wiz.h
Expand Up @@ -28,12 +28,6 @@
/* General platform specific identifiers */
#include "SDL_platform.h"

/* Make sure that this isn't included by Visual C++ */
#ifdef _MSC_VER
#error You should copy include/SDL_config.h.default to include/SDL_config.h
#endif

#define SDL_HAS_64BIT_TYPE 1
#define SDL_BYTEORDER 1234

#define HAVE_ALLOCA_H 1
Expand Down
9 changes: 0 additions & 9 deletions include/SDL_endian.h
Expand Up @@ -153,7 +153,6 @@ SDL_Swap32(Uint32 x)
}
#endif

#ifdef SDL_HAS_64BIT_TYPE
#if defined(__GNUC__) && defined(__i386__)
static __inline__ Uint64
SDL_Swap64(Uint64 x)
Expand Down Expand Up @@ -195,14 +194,6 @@ SDL_Swap64(Uint64 x)
return (x);
}
#endif
#else
/**
* This is mainly to keep compilers from complaining in SDL code.
* If there is no real 64-bit datatype, then compilers will complain about
* the fake 64-bit datatype that SDL provides when it compiles user code.
*/
#define SDL_Swap64(X) (X)
#endif /* SDL_HAS_64BIT_TYPE */


static __inline__ float
Expand Down
14 changes: 0 additions & 14 deletions include/SDL_stdinc.h
Expand Up @@ -144,22 +144,14 @@ typedef int32_t Sint32;
*/
typedef uint32_t Uint32;

#ifdef SDL_HAS_64BIT_TYPE
/**
* \brief A signed 64-bit integer type.
* \warning On platforms without any sort of 64-bit datatype, this is equivalent to Sint32!
*/
typedef int64_t Sint64;
/**
* \brief An unsigned 64-bit integer type.
* \warning On platforms without any sort of 64-bit datatype, this is equivalent to Uint32!
*/
typedef uint64_t Uint64;
#else
/* This is really just a hack to prevent the compiler from complaining */
typedef Sint32 Sint64;
typedef Uint32 Uint64;
#endif

/*@}*//*Basic data types*/

Expand All @@ -174,10 +166,8 @@ SDL_COMPILE_TIME_ASSERT(uint16, sizeof(Uint16) == 2);
SDL_COMPILE_TIME_ASSERT(sint16, sizeof(Sint16) == 2);
SDL_COMPILE_TIME_ASSERT(uint32, sizeof(Uint32) == 4);
SDL_COMPILE_TIME_ASSERT(sint32, sizeof(Sint32) == 4);
#ifdef SDL_HAS_64BIT_TYPE
SDL_COMPILE_TIME_ASSERT(uint64, sizeof(Uint64) == 8);
SDL_COMPILE_TIME_ASSERT(sint64, sizeof(Sint64) == 8);
#endif
#endif /* DOXYGEN_SHOULD_IGNORE_THIS */
/** \endcond */

Expand Down Expand Up @@ -545,8 +535,6 @@ extern DECLSPEC unsigned long SDLCALL SDL_strtoul(const char *string,
char **endp, int base);
#endif

#ifdef SDL_HAS_64BIT_TYPE

#ifdef HAVE__I64TOA
#define SDL_lltoa _i64toa
#else
Expand Down Expand Up @@ -575,8 +563,6 @@ extern DECLSPEC Uint64 SDLCALL SDL_strtoull(const char *string, char **endp,
int base);
#endif

#endif /* SDL_HAS_64BIT_TYPE */

#ifdef HAVE_STRTOD
#define SDL_strtod strtod
#else
Expand Down
34 changes: 3 additions & 31 deletions src/stdlib/SDL_string.c
Expand Up @@ -149,7 +149,6 @@ SDL_ScanUintPtrT(const char *text, int radix, uintptr_t * valuep)
}
#endif

#ifdef SDL_HAS_64BIT_TYPE
#if !defined(HAVE_SSCANF) || !defined(HAVE_STRTOLL)
static size_t
SDL_ScanLongLong(const char *text, int radix, Sint64 * valuep)
Expand Down Expand Up @@ -222,7 +221,6 @@ SDL_ScanUnsignedLongLong(const char *text, int radix, Uint64 * valuep)
return (text - textstart);
}
#endif
#endif /* SDL_HAS_64BIT_TYPE */

#if !defined(HAVE_SSCANF) || !defined(HAVE_STRTOD)
static size_t
Expand Down Expand Up @@ -679,8 +677,6 @@ SDL_strtoul(const char *string, char **endp, int base)
}
#endif

#ifdef SDL_HAS_64BIT_TYPE

#ifndef HAVE__I64TOA
char *
SDL_lltoa(Sint64 value, char *string, int radix)
Expand Down Expand Up @@ -781,8 +777,6 @@ SDL_strtoull(const char *string, char **endp, int base)
}
#endif

#endif /* SDL_HAS_64BIT_TYPE */

#ifndef HAVE_STRTOD
double
SDL_strtod(const char *string, char **endp)
Expand Down Expand Up @@ -976,7 +970,6 @@ SDL_sscanf(const char *text, const char *fmt, ...)
}
/* Fall through to %d handling */
case 'd':
#ifdef SDL_HAS_64BIT_TYPE
if (inttype == DO_LONGLONG) {
Sint64 value;
text += SDL_ScanLongLong(text, radix, &value);
Expand All @@ -985,9 +978,7 @@ SDL_sscanf(const char *text, const char *fmt, ...)
*valuep = value;
++retval;
}
} else
#endif /* SDL_HAS_64BIT_TYPE */
{
} else {
long value;
text += SDL_ScanLong(text, radix, &value);
if (!suppress) {
Expand Down Expand Up @@ -1031,7 +1022,6 @@ SDL_sscanf(const char *text, const char *fmt, ...)
}
/* Fall through to unsigned handling */
case 'u':
#ifdef SDL_HAS_64BIT_TYPE
if (inttype == DO_LONGLONG) {
Uint64 value;
text += SDL_ScanUnsignedLongLong(text, radix, &value);
Expand All @@ -1040,9 +1030,7 @@ SDL_sscanf(const char *text, const char *fmt, ...)
*valuep = value;
++retval;
}
} else
#endif /* SDL_HAS_64BIT_TYPE */
{
} else {
unsigned long value;
text += SDL_ScanUnsignedLong(text, radix, &value);
if (!suppress) {
Expand Down Expand Up @@ -1194,7 +1182,6 @@ SDL_PrintUnsignedLong(char *text, unsigned long value, int radix,
return size;
}

#ifdef SDL_HAS_64BIT_TYPE
static size_t
SDL_PrintLongLong(char *text, Sint64 value, int radix, size_t maxlen)
{
Expand Down Expand Up @@ -1226,7 +1213,7 @@ SDL_PrintUnsignedLongLong(char *text, Uint64 value, int radix, size_t maxlen)

return size;
}
#endif /* SDL_HAS_64BIT_TYPE */

static size_t
SDL_PrintFloat(char *text, double arg, size_t maxlen)
{
Expand Down Expand Up @@ -1343,16 +1330,10 @@ SDL_vsnprintf(char *text, size_t maxlen, const char *fmt, va_list ap)
radix, maxlen);
break;
case DO_LONGLONG:
#ifdef SDL_HAS_64BIT_TYPE
len =
SDL_PrintLongLong(text,
va_arg(ap, Sint64),
radix, maxlen);
#else
len =
SDL_PrintLong(text, va_arg(ap, long),
radix, maxlen);
#endif
break;
}
done = SDL_TRUE;
Expand Down Expand Up @@ -1392,20 +1373,11 @@ SDL_vsnprintf(char *text, size_t maxlen, const char *fmt, va_list ap)
radix, maxlen);
break;
case DO_LONGLONG:
#ifdef SDL_HAS_64BIT_TYPE
len =
SDL_PrintUnsignedLongLong(text,
va_arg(ap,
Uint64),
radix, maxlen);
#else
len =
SDL_PrintUnsignedLong(text,
va_arg(ap,
unsigned
long),
radix, maxlen);
#endif
break;
}
if (do_lowercase) {
Expand Down

0 comments on commit a3d76f6

Please sign in to comment.