Port to *BSD. It runs but isn't terribly useful without Cg.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5934 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Soren Jorvang
2010-07-22 03:29:35 +00:00
parent cdce0ec322
commit 83883cee45
29 changed files with 5353 additions and 148 deletions

View File

@ -10,7 +10,14 @@ files = [
'src/joystick/SDL_joystick.c',
]
if sys.platform == 'darwin':
if sys.platform.count('bsd'):
env['LIBS'] += ['usbhid']
files += [
'src/joystick/bsd/SDL_sysjoystick.c',
'src/stdlib/SDL_malloc.c',
'src/stdlib/SDL_string.c',
]
elif sys.platform == 'darwin':
files += [
'src/joystick/darwin/SDL_sysjoystick.c',
]
@ -19,6 +26,10 @@ elif sys.platform == 'linux2':
'src/joystick/linux/SDL_sysjoystick.c',
'src/stdlib/SDL_string.c',
]
elif sys.platform == 'win32':
files += [
'src/joystick/win32/SDL_mmjoystick.c',
]
else:
files += [
'src/joystick/dummy/SDL_sysjoystick.c',

67
Externals/SDL/SDL/SDL_config_bsd.h vendored Normal file
View File

@ -0,0 +1,67 @@
#ifndef _SDL_config_h
#define _SDL_config_h
#include <sys/ioctl.h> /* XXX */
#define SDL_JOYSTICK_USBHID 1
#ifdef __FreeBSD__
#define HAVE_USBHID_H
#endif
#define USBHID_NEW
#define USBHID_UCR_DATA
#define HAVE_ABS 1
#define HAVE_ALLOCA 1
#define HAVE_ATOF 1
#define HAVE_ATOI 1
#define HAVE_BCOPY 1
#define HAVE_CALLOC 1
#define HAVE_CTYPE_H 1
#define HAVE_FREE 1
#define HAVE_GETENV 1
#define HAVE_INTTYPES_H 1
#define HAVE_MALLOC 1
#define HAVE_MATH_H 1
#define HAVE_MEMCMP 1
#define HAVE_MEMCPY 1
#define HAVE_MEMMOVE 1
#define HAVE_MEMORY_H 1
#define HAVE_MEMSET 1
#define HAVE_MPROTECT 1
#define HAVE_NANOSLEEP 1
#define HAVE_PUTENV 1
#define HAVE_QSORT 1
#define HAVE_REALLOC 1
#define HAVE_SETJMP 1
#define HAVE_SIGACTION 1
#define HAVE_SIGNAL_H 1
#define HAVE_SNPRINTF 1
#define HAVE_SSCANF 1
#define HAVE_STDARG_H 1
#define HAVE_STDINT_H 1
#define HAVE_STDIO_H 1
#define HAVE_STDLIB_H 1
#define HAVE_STRCASECMP 1
#define HAVE_STRCHR 1
#define HAVE_STRCMP 1
#define HAVE_STRDUP 1
#define HAVE_STRINGS_H 1
#define HAVE_STRING_H 1
#define HAVE_STRLCAT 1
#define HAVE_STRLCPY 1
#define HAVE_STRLEN 1
#define HAVE_STRNCASECMP 1
#define HAVE_STRNCMP 1
#define HAVE_STRRCHR 1
#define HAVE_STRSTR 1
#define HAVE_STRTOD 1
#define HAVE_STRTOL 1
#define HAVE_STRTOLL 1
#define HAVE_STRTOUL 1
#define HAVE_STRTOULL 1
#define HAVE_SYS_TYPES_H
#define HAVE_UNSETENV 1
#define HAVE_VSNPRINTF 1
#endif

View File

@ -1,5 +1,9 @@
#include <sys/param.h>
#if defined __APPLE__
#include "include/SDL_config_macosx.h"
#elif defined BSD4_4
#include "SDL/SDL_config_bsd.h"
#elif defined __linux__
#include "SDL/SDL_config_linux.h"
#endif

View File

@ -197,12 +197,12 @@ SDL_SYS_JoystickInit(void)
}
const char *
SDL_SYS_JoystickName(int index)
SDL_SYS_JoystickName(int jindex)
{
if (joydevnames[index] != NULL) {
return (joydevnames[index]);
if (joydevnames[jindex] != NULL) {
return (joydevnames[jindex]);
}
return (joynames[index]);
return (joynames[jindex]);
}
static int

5111
Externals/SDL/src/stdlib/SDL_malloc.c vendored Normal file

File diff suppressed because it is too large Load Diff