~ubuntu-branches/ubuntu/wily/flrig/wily

« back to all changes in this revision

Viewing changes to .pc/0001-License-Declaration.patch/src/include/mingw.h

  • Committer: Package Import Robot
  • Author(s): Kamal Mostafa
  • Date: 2014-06-07 11:28:52 UTC
  • Revision ID: package-import@ubuntu.com-20140607112852-pj9xhtlvwpgqjy5x
Tags: 1.3.15-1
* Initial release (Closes: #750861)
  flrig version 1.3.15 plus the following upstream commits:
  - 0001-License-Declaration.patch
  - 0002-FL_APPS-folder.patch
  - 0003-rig-home-dir.patch
  - 0004-RTS-DTR-restore.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef MINGW_H_
 
2
#define MINGW_H_
 
3
 
 
4
#include <sys/types.h>
 
5
#include <pthread.h>
 
6
#include <winsock2.h>
 
7
 
 
8
#ifdef __cplusplus
 
9
extern "C" {
 
10
#endif
 
11
 
 
12
typedef int pid_t;
 
13
typedef long suseconds_t;
 
14
#define hstrerror strerror
 
15
 
 
16
#ifndef SIGUSR2
 
17
#  define SIGUSR2 100
 
18
#endif
 
19
 
 
20
/*
 
21
 * simple adaptors
 
22
 */
 
23
 
 
24
static inline int mingw_mkdir(const char *path, int mode)
 
25
{
 
26
        return mkdir(path);
 
27
}
 
28
#define mkdir mingw_mkdir
 
29
 
 
30
static inline int mingw_unlink(const char *pathname)
 
31
{
 
32
        /* read-only files cannot be removed */
 
33
        chmod(pathname, 0666);
 
34
        return unlink(pathname);
 
35
}
 
36
#define unlink mingw_unlink
 
37
 
 
38
/*
 
39
 * implementations of missing functions
 
40
 */
 
41
 
 
42
unsigned int sleep (unsigned int seconds);
 
43
char *mingw_getcwd(char *pointer, int len);
 
44
#define getcwd mingw_getcwd
 
45
char *mingw_getenv(const char *name);
 
46
#define getenv mingw_getenv
 
47
int mingw_rename(const char*, const char*);
 
48
#define rename mingw_rename
 
49
 
 
50
#ifndef SHUT_WR
 
51
#  define SHUT_WR SD_SEND
 
52
#endif
 
53
#ifndef SHUT_RD
 
54
#  define SHUT_RD SD_RECEIVE
 
55
#endif
 
56
#ifndef SHUT_RDWR
 
57
#  define SHUT_RDWR SD_BOTH
 
58
#endif
 
59
#ifndef EADDRINUSE
 
60
#  define EADDRINUSE WSAEADDRINUSE
 
61
#endif
 
62
 
 
63
int nanosleep (const struct timespec *req, struct timespec *rem);
 
64
int socketpair(int family, int type, int protocol, int *sv);
 
65
 
 
66
/* uname */
 
67
#define UTSNAME_MAX_ 257
 
68
struct utsname
 
69
{
 
70
        char sysname[UTSNAME_MAX_];
 
71
        char nodename[UTSNAME_MAX_];
 
72
        char release[UTSNAME_MAX_];
 
73
        char version[UTSNAME_MAX_];
 
74
        char machine[UTSNAME_MAX_];
 
75
};
 
76
int uname(struct utsname *name);
 
77
 
 
78
/* getrusage */
 
79
#define RUSAGE_SELF     0
 
80
#define RUSAGE_CHILDREN (-1)
 
81
struct rusage
 
82
{
 
83
        struct timeval ru_utime;
 
84
        struct timeval ru_stime;
 
85
};
 
86
int getrusage(int who, struct rusage *usage);
 
87
 
 
88
/* fsync, fdatasync */
 
89
#include <io.h>
 
90
#define fsync _commit
 
91
#define fdatasync fsync
 
92
 
 
93
#ifdef __cplusplus
 
94
}
 
95
#endif
 
96
 
 
97
#endif