From 7204b84beb0f5cfb166e8d56402371d05bece83b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Dvo=C5=99=C3=A1k?= Date: Mon, 20 Sep 2004 19:30:02 +0000 Subject: Build system improvements: - use replacement functions (macro AC_REPLACE_FUNCS and variable LTLIBOBJS), each function is in a file placed into lib/ directory, it was not necessary, but it looks nice, IMHO - headers cleanups (this was needed): - prototypes of replacement funtions and macros are placed into separate os_internal.h (and included by config.h) - drop include inttypes.h from public xine.h, replaced by custom os_type.h, idea origins from Ogg/Vorbis public headers - disable generating inttypes.h: generated replacement isn't enough for xine-lib but nobody complained (and for M$VC we have special version) - better including headers for win32, let dvdnav use its mutex wrapper - updated M$VC port Result: - xine is compiled nicely by MinGW, CygWin and paritaly M$VC - frontends in M$VC port don't require additional helping headers - moved some platform specific things from xine-utils and win32/contrib to lib/ Finally I can start with real coding. :-) CVS patchset: 6982 CVS date: 2004/09/20 19:30:02 --- win32/contrib/timer/timer.c | 126 -------------------------------------------- 1 file changed, 126 deletions(-) delete mode 100644 win32/contrib/timer/timer.c (limited to 'win32/contrib/timer/timer.c') diff --git a/win32/contrib/timer/timer.c b/win32/contrib/timer/timer.c deleted file mode 100644 index 3b171117c..000000000 --- a/win32/contrib/timer/timer.c +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (C) 2000-2001 the xine project - * - * This file is part of xine, a unix video player. - * - * xine is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * xine 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - * - * WIN32 PORT, - * by Matthew Grooms - * - * timer.c - Missing unix timer functions - * - */ - -#include -#include -#include "timer.h" - - -#ifndef SIGALRM -#define SIGALRM 14 -#endif - - -int gettimeofday(struct timeval *tv, struct timezone *tz) { - struct timeb timebuffer; - - ftime(&timebuffer); - tv->tv_sec = timebuffer.time; - tv->tv_usec = timebuffer.millitm * 1000; - - return 0; -} - - -/* - These functions are designed to mimick - a subset of itimer for use with the - alarm signal on win32. This is just - enough for xine to work. -*/ - -static HANDLE sigalarm = 0; - -int setitimer( int which, struct itimerval * value, struct itimerval *ovalue ) -{ - long int miliseconds; - - if( !sigalarm ) - sigalarm = CreateEvent( 0, FALSE, TRUE, "SIGALARM" ); - - miliseconds = value->it_value.tv_usec / 1000; - - timeSetEvent( miliseconds, 0, ( LPTIMECALLBACK ) sigalarm, 0, TIME_PERIODIC | TIME_CALLBACK_EVENT_PULSE ); - - return 0; -} - -/* - Wait for sigalarm to wake the thread -*/ - -int pause( void ) -{ - WaitForSingleObject( sigalarm, INFINITE ); - - return 0; -} - -int nanosleep( const struct timespec * rqtp, struct timespec * rmtp ) -{ - Sleep( rqtp->tv_nsec / 1000000 ); - - return 0; -} - -unsigned int sleep( unsigned int seconds ) -{ - Sleep( seconds * 1000 ); - return 0; -} - -static UINT alarmid = 0; -void CALLBACK AlarmCallback(UINT wTimerID, - UINT msg, - DWORD dwUser, - DWORD dw1, - DWORD dw2) -{ - if (alarmid) { - alarmid = 0; - raise(SIGALRM); - } -} - -int alarm( int sec ) -{ - long int miliseconds; - - if (sec) { - if (!alarmid) { - miliseconds = sec * 1000; - timeSetEvent( miliseconds, 0, ( LPTIMECALLBACK ) AlarmCallback, 0, TIME_ONESHOT | TIME_CALLBACK_FUNCTION ); - } - } - else { - if (alarmid) { - timeKillEvent(alarmid); - alarmid = 0; - } - } - - return 0; -} -- cgit v1.2.3