Use consistent identifiers for the various platforms we support.
Make sure every source file includes SDL_config.h, so the proper system headers are chosen. --HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401406
This commit is contained in:
parent
14ec0fcc7b
commit
c36118165e
502 changed files with 974 additions and 219 deletions
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
/* These are functions that need to be implemented by a port of SDL */
|
||||
|
||||
|
@ -31,7 +32,7 @@
|
|||
saves a system-dependent thread id in thread->id, and returns 0
|
||||
on success.
|
||||
*/
|
||||
#if defined(_WIN32) || defined(__OS2__)
|
||||
#if defined(__WIN32__) || defined(__OS2__)
|
||||
extern int SDL_SYS_CreateThread(SDL_Thread *thread, void *args, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread);
|
||||
#else
|
||||
extern int SDL_SYS_CreateThread(SDL_Thread *thread, void *args);
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
/* System independent thread management routines for SDL */
|
||||
|
||||
|
@ -208,7 +209,7 @@ void SDL_RunThread(void *data)
|
|||
*statusloc = userfunc(userdata);
|
||||
}
|
||||
|
||||
#if defined(_WIN32) || defined(__OS2__)
|
||||
#if defined(__WIN32__) || defined(__OS2__)
|
||||
#undef SDL_CreateThread
|
||||
DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (*fn)(void *), void *data, pfnSDL_CurrentBeginThread pfnBeginThread, pfnSDL_CurrentEndThread pfnEndThread)
|
||||
#else
|
||||
|
@ -249,7 +250,7 @@ DECLSPEC SDL_Thread * SDLCALL SDL_CreateThread(int (*fn)(void *), void *data)
|
|||
SDL_AddThread(thread);
|
||||
|
||||
/* Create the thread and go! */
|
||||
#if defined(_WIN32) || defined(__OS2__)
|
||||
#if defined(__WIN32__) || defined(__OS2__)
|
||||
ret = SDL_SYS_CreateThread(thread, args, pfnBeginThread, pfnEndThread);
|
||||
#else
|
||||
ret = SDL_SYS_CreateThread(thread, args);
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#ifndef _SDL_thread_c_h
|
||||
#define _SDL_thread_c_h
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
/* An implementation of semaphores using mutexes and condition variables */
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
/* BeOS thread management routines for SDL */
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#include <exec/exec.h>
|
||||
#include <dos/dos.h>
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
/* System independent thread management routines for SDL */
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
/* Semaphores in the BeOS environment */
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
/* BeOS thread management routines for SDL */
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#include <signal.h>
|
||||
#include <be/kernel/OS.h>
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
/* An implementation of condition variables using semaphores and mutexes */
|
||||
/*
|
||||
|
|
|
@ -19,4 +19,5 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
/* An implementation of mutexes using semaphores */
|
||||
|
||||
|
|
|
@ -19,4 +19,5 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
/* An implementation of semaphores using mutexes and condition variables */
|
||||
|
||||
|
|
|
@ -19,4 +19,5 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
/* Thread management routines for SDL */
|
||||
|
||||
|
|
|
@ -19,5 +19,6 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
typedef struct kthread* SYS_ThreadHandle;
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
/*
|
||||
SDL_systhread_c.h
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
/* An implementation of condition variables using semaphores and mutexes */
|
||||
/*
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
/* An implementation of mutexes using semaphores */
|
||||
|
||||
|
|
|
@ -19,4 +19,5 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
/* An implementation of semaphores using mutexes and condition variables */
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
/* Thread management routines for SDL */
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
/* Stub until we implement threads on this platform */
|
||||
typedef int SYS_ThreadHandle;
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#include "SDL_thread.h"
|
||||
#include "SDL_timer.h"
|
||||
|
@ -103,7 +104,7 @@ SDL_sem *SDL_CreateSemaphore(Uint32 initial_value)
|
|||
void SDL_DestroySemaphore(SDL_sem *sem)
|
||||
{
|
||||
if ( sem ) {
|
||||
#ifdef _SGI_SOURCE
|
||||
#ifdef __IRIX__
|
||||
semctl(sem->id, 0, IPC_RMID);
|
||||
#else
|
||||
union semun dummy;
|
||||
|
@ -193,7 +194,7 @@ Uint32 SDL_SemValue(SDL_sem *sem)
|
|||
value = 0;
|
||||
if ( sem ) {
|
||||
tryagain:
|
||||
#ifdef _SGI_SOURCE
|
||||
#ifdef __IRIX__
|
||||
semval = semctl(sem->id, 0, GETVAL);
|
||||
#else
|
||||
{
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
/* IRIX thread management routines for SDL */
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
/* An implementation of condition variables using semaphores and mutexes */
|
||||
/*
|
||||
|
|
|
@ -19,4 +19,5 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
/* Mutex functions using the OS/2 API */
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
/* Semaphore functions using the OS/2 API */
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
/* OS/2 thread management routines for SDL */
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#define INCL_DOSPROCESS
|
||||
#include <os2.h>
|
||||
|
|
|
@ -1,3 +1,26 @@
|
|||
/*
|
||||
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
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
/*
|
||||
* GNU pth conditions variables
|
||||
*
|
||||
|
|
|
@ -1,3 +1,26 @@
|
|||
/*
|
||||
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
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
/*
|
||||
* GNU pth mutexes
|
||||
*
|
||||
|
|
|
@ -1,3 +1,26 @@
|
|||
/*
|
||||
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
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#ifndef _SDL_SYSMUTEX_C_H_
|
||||
#define _SDL_SYSMUTEX_C_H_
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
/*
|
||||
* GNU pth threads
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#ifndef _SDL_SYSTHREAD_C_H_
|
||||
#define _SDL_SYSTHREAD_C_H_
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#include <sys/time.h>
|
||||
#include <unistd.h>
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#ifndef _SDL_mutex_c_h
|
||||
#define _SDL_mutex_c_h
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#include <pthread.h>
|
||||
#include <semaphore.h>
|
||||
|
@ -28,9 +29,9 @@
|
|||
|
||||
/* Wrapper around POSIX 1003.1b semaphores */
|
||||
|
||||
#if MACOSX
|
||||
#ifdef __MACOSX__
|
||||
#define USE_NAMED_SEMAPHORES 1
|
||||
#endif /* MACOSX */
|
||||
#endif
|
||||
|
||||
struct SDL_semaphore {
|
||||
sem_t *sem;
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#include <pthread.h>
|
||||
#include <signal.h>
|
||||
|
@ -96,7 +97,7 @@ void SDL_SYS_KillThread(SDL_Thread *thread)
|
|||
#ifdef PTHREAD_CANCEL_ASYNCHRONOUS
|
||||
pthread_cancel(thread->handle);
|
||||
#else
|
||||
#ifdef __FreeBSD__
|
||||
#ifdef __FREEBSD__
|
||||
#warning For some reason, this doesnt actually kill a thread - FreeBSD 3.2
|
||||
#endif
|
||||
pthread_kill(thread->handle, SIGKILL);
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#include <pthread.h>
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
/* RISC OS implementations uses pthreads based on linux code */
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
/* RISC OS implementations uses pthreads based on linux code */
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#ifndef _SDL_mutex_c_h
|
||||
#define _SDL_mutex_c_h
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
/* RISC OS semiphores based on linux code */
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
/* RISC OS version based on pthreads linux source */
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#if SDL_THREADS_DISABLED
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
/* Mutex functions using the Win32 API */
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
/* Semaphore functions using the Win32 API */
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
/* Win32 thread management routines for SDL */
|
||||
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
Sam Lantinga
|
||||
slouken@libsdl.org
|
||||
*/
|
||||
#include "SDL_config.h"
|
||||
|
||||
#include "SDL_windows.h"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue