File: compat.h

package info (click to toggle)
termrec 0.19-2.1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,024 kB
  • sloc: ansic: 8,435; makefile: 182; perl: 16; sh: 15
file content (31 lines) | stat: -rw-r--r-- 650 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef _COMPAT_H
#define _COMPAT_H

#include "config.h"

#ifdef WIN32
# include "win32/net.h"
#else
# define closesocket(x) close(x)
#endif

#ifndef HAVE_ASPRINTF
int asprintf(char **sptr, const char *fmt, ...);
int vasprintf(char **sptr, const char *fmt, va_list ap);
#endif
#ifndef HAVE_GETTIMEOFDAY
void gettimeofday(struct timeval *tv, void * dummy);
#endif
#ifndef HAVE_USLEEP
void usleep(unsigned int usec);
#endif
#ifndef HAVE_PIPE
int pipe(int pipefd[2]);
#endif
#ifndef HAVE_SELECT
// for now, select() _only_ as microsecond sleep()
# define select(d1,d2,d3,d4,timeout) uselect(timeout)
int uselect(struct timeval *timeout);
#endif

#endif