Revision e9d511dc libavformat/os_support.h

View differences:

libavformat/os_support.h
26 26
 * @file os_support.h
27 27
 * miscellaneous OS support macros and functions.
28 28
 *
29
 * - socklen_t typedef (BeOS, Innotek libc)
29 30
 * - usleep() (Win32, BeOS, OS/2)
30 31
 * - lseek() (Win32)
31 32
 * - floatf() (OS/2)
32 33
 * - strcasecmp() (OS/2)
34
 * - closesocket()
33 35
 */
34 36

  
37
#if defined(__BEOS__) || defined(__INNOTEK_LIBC__)
38
typedef int socklen_t;
39
#endif
40

  
35 41
#ifdef __MINGW32__
36 42
__declspec(dllimport) void __stdcall Sleep(unsigned long dwMilliseconds);
37 43
// #  include <windows.h>
......
40 46
#  define lseek(f,p,w) _lseeki64((f), (p), (w))
41 47
#endif
42 48

  
49
/* XXX: check for Winsock here */
50
#if 0
51
#define HAVE_CLOSESOCKET 1
52
#endif
53

  
43 54
#ifdef __BEOS__
44
#  ifndef usleep
55
#  include <sys/socket.h>
56
#  include <netinet/in.h>
57
   /* not net_server ? */
58
#  if IPPROTO_TCP != 6
59
#    define HAVE_CLOSESOCKET 1
60
#  endif
61
#  include <BeBuild.h>
62
   /* R5 didn't have usleep, fake it. Haiku and Zeta has it now. */
63
#  if B_BEOS_VERSION <= B_BEOS_VERSION_5
45 64
#    include <OS.h>
65
     /* doesn't set errno but that's enough */
46 66
#    define usleep(t)  snooze((bigtime_t)(t))
47 67
#  endif
48 68
#endif
......
53 73
static inline int strcasecmp(const char* s1, const char* s2) { return stricmp(s1,s2); }
54 74
#endif
55 75

  
76
/* most of the time closing a socket is just closing an fd */
77
#if HAVE_CLOSESOCKET != 1
78
#define closesocket close
79
#endif
80

  
56 81
#endif /* _OS_SUPPORT_H */

Also available in: Unified diff