]> git.sesse.net Git - ffmpeg/blob - libavformat/os_support.h
018b8f8e920dc7689a8213862c3461a8ea54590c
[ffmpeg] / libavformat / os_support.h
1 /*
2  * various utilities for ffmpeg system
3  * copyright (c) 2000, 2001, 2002 Fabrice Bellard
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18  */
19
20 #ifndef _OS_SUPPORT_H
21 #define _OS_SUPPORT_H
22
23 /**
24  * @file os_support.h
25  * miscellaneous OS support macros and functions.
26  *
27  * - usleep() (Win32, BeOS, OS/2)
28  * - floatf() (OS/2)
29  * - strcasecmp() (OS/2)
30  */
31
32 #ifdef __MINGW32__
33 __declspec(dllimport) void __stdcall Sleep(unsigned long dwMilliseconds);
34 // #  include <windows.h>
35 #  define usleep(t)    Sleep((t) / 1000)
36 #endif
37
38 #ifdef __BEOS__
39 #  ifndef usleep
40 #    include <OS.h>
41 #    define usleep(t)  snooze((bigtime_t)(t))
42 #  endif
43 #endif
44
45 #if defined(CONFIG_OS2)
46 #include <stdlib.h>
47 static inline int usleep(unsigned int t) { return _sleep2(t / 1000); }
48 static inline int strcasecmp(const char* s1, const char* s2) { return stricmp(s1,s2); }
49 #endif
50
51 #endif /* _OS_SUPPORT_H */