ekg2
 All Struktury Danych Pliki Funkcje Zmienne Definicje typów Wyliczenia Wartości wyliczeń Definicje Grupay Strony
win32.h
Idź do dokumentacji tego pliku.
1 #ifdef __MINGW32__
2 # define NO_POSIX_SYSTEM "mingw"
3 #else
4 # define EKG2_WIN32_H
5 # undef NO_POSIX_SYSTEM
6 #endif
7 
8 #ifndef EKG2_WIN32_H
9 #define EKG2_WIN32_H
10 
11 #include "ekg2-config.h"
12 
13 #ifdef PLUGIN_SHARED_LIBS
14 # define EKG2_WIN32_SHARED_LIB "da! we want shared libs...... DLL's HELL! :> yeah, let's rock."
15 # define EKG2_WIN32_HELPERS
16 #endif
17 
18 #if 0
19  typedef unsigned long uint32_t;
20  typedef unsigned short uint16_t;
21  typedef unsigned char uint8_t;
22 #endif
23 
24 #include <windef.h>
25 #include <stdint.h>
26 #include <stdlib.h>
27 #include <winsock2.h>
28 #include <ws2tcpip.h>
29 
30 #include <sys/types.h>
31 #include <sys/stat.h>
32 #include <unistd.h>
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 #undef pipe
39 typedef unsigned __int64 u_int64_t;
40 
41 struct utsname {
42 /* XXX, len */
43  char sysname[30];
44  char nodename[30];
45  char release[30];
46  char version[30];
47  char machine[30];
48 };
49 
50 struct timezone { /* XXX */
51  int tz_minuteswest; /* minutes west of Greenwich */
52  int tz_dsttime; /* type of DST correction */
53 };
54 /* shared */
55 #ifdef EKG2_WIN32_SHARED_LIB
56 # define EKG2_WIN32_NOFUNCTION 1
57 # error "Currently --enable-shared don't work automagicly pass --enable-static to ./configure if you really want. contact with me. (jid:darkjames@chrome.pl)"
58 # include "win32_helper.h"
59 #endif
60 
61 #define THREAD(x) DWORD x(void *data)
62 typedef THREAD(thread_func_t);
63 
64 # ifndef EKG2_WIN32_NOFUNCTION
65 pid_t fork(void); /* unimpl */
66 HANDLE win32_fork(thread_func_t *addr, void *data);
67 
68 /* fcntl.h */
69 #define F_SETFL 4
70 #define O_NONBLOCK 04000
71 int fcntl(int fd, int cmd, long arg);
72 /* ... */
73 
74 int fchmod(int fildes, mode_t mode); /* unimpl */
75 int pipe(int *filedes);
76 
77 int gettimeofday(struct timeval *tv, struct timezone *tz); /* emulated */
78 int ioctl(int fd, int request, void *flags); /* BAD PROTOTYPE. I KNOW. XXX, emulate some things */
79 int uname(struct utsname *buf); /* emulated ? */
80 
81 #endif
82 
83 #define EINPROGRESS WSAEINPROGRESS
84 
85 #define fileno(__F) ((__F)->_file)
86 #define sleep(x) Sleep(x * 1000)
87 
88 #ifdef __cplusplus
89 }
90 #endif
91 
92 #endif
93