Made winebuild (almost) compile and work on Windows.
This commit is contained in:
parent
136fae57c3
commit
235da7975b
|
@ -29,6 +29,60 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#ifdef HAVE_DIRECT_H
|
||||||
|
# include <direct.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_IO_H
|
||||||
|
# include <io.h>
|
||||||
|
#endif
|
||||||
|
#ifdef HAVE_UNISTD_H
|
||||||
|
# include <unistd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(HAVE_POPEN) && defined(HAVE__POPEN)
|
||||||
|
#define popen _popen
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(HAVE_PCLOSE) && defined(HAVE__PCLOSE)
|
||||||
|
#define pclose _pclose
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(HAVE_STRNCASECMP) && defined(HAVE__STRNICMP)
|
||||||
|
# define strncasecmp _strnicmp
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(HAVE_STRCASECMP) && defined(HAVE__STRICMP)
|
||||||
|
# define strcasecmp _stricmp
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define PUT_WORD(ptr, w) (*(WORD *)(ptr) = (w))
|
||||||
|
#define PUT_LE_WORD(ptr, w) \
|
||||||
|
do { ((BYTE *)(ptr))[0] = LOBYTE(w); \
|
||||||
|
((BYTE *)(ptr))[1] = HIBYTE(w); } while (0)
|
||||||
|
#define PUT_BE_WORD(ptr, w) \
|
||||||
|
do { ((BYTE *)(ptr))[1] = LOBYTE(w); \
|
||||||
|
((BYTE *)(ptr))[0] = HIBYTE(w); } while (0)
|
||||||
|
|
||||||
|
#if defined(ALLOW_UNALIGNED_ACCESS)
|
||||||
|
#define PUT_UA_WORD(ptr, w) PUT_WORD(ptr, w)
|
||||||
|
#elif defined(WORDS_BIGENDIAN)
|
||||||
|
#define PUT_UA_WORD(ptr, w) PUT_BE_WORD(ptr, w)
|
||||||
|
#else
|
||||||
|
#define PUT_UA_WORD(ptr, w) PUT_LE_WORD(ptr, w)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef NEED_UNDERSCORE_PREFIX
|
||||||
|
# define __ASM_NAME(name) "_" name
|
||||||
|
#else
|
||||||
|
# define __ASM_NAME(name) name
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef NEED_TYPE_IN_DEF
|
||||||
|
# define __ASM_FUNC(name) ".def " __ASM_NAME(name) "; .scl 2; .type 32; .endef"
|
||||||
|
#else
|
||||||
|
# define __ASM_FUNC(name) ".type " __ASM_NAME(name) ",@function"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef NEED_UNDERSCORE_PREFIX
|
#ifdef NEED_UNDERSCORE_PREFIX
|
||||||
# define PREFIX "_"
|
# define PREFIX "_"
|
||||||
|
|
|
@ -23,10 +23,8 @@
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "winnt.h"
|
|
||||||
#include "build.h"
|
#include "build.h"
|
||||||
|
|
||||||
struct import
|
struct import
|
||||||
|
|
|
@ -26,11 +26,9 @@
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "winnt.h"
|
|
||||||
#include "build.h"
|
#include "build.h"
|
||||||
|
|
||||||
ORDDEF *EntryPoints[MAX_ORDINALS];
|
ORDDEF *EntryPoints[MAX_ORDINALS];
|
||||||
|
|
|
@ -29,7 +29,6 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
#include "winbase.h"
|
#include "winbase.h"
|
||||||
#include "build.h"
|
#include "build.h"
|
||||||
|
|
|
@ -25,9 +25,7 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
#include "winnt.h"
|
|
||||||
#include "thread.h"
|
#include "thread.h"
|
||||||
#include "stackframe.h"
|
#include "stackframe.h"
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,6 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
|
@ -24,7 +24,6 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <unistd.h>
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
|
|
@ -23,7 +23,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "wine/port.h"
|
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
|
@ -26,7 +26,6 @@
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <unistd.h>
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "winbase.h"
|
#include "winbase.h"
|
||||||
|
@ -439,12 +438,16 @@ void BuildSpec32File( FILE *outfile )
|
||||||
|
|
||||||
#ifdef HAVE_GETPAGESIZE
|
#ifdef HAVE_GETPAGESIZE
|
||||||
page_size = getpagesize();
|
page_size = getpagesize();
|
||||||
#else
|
#elif defined(__svr4__)
|
||||||
# ifdef __svr4__
|
|
||||||
page_size = sysconf(_SC_PAGESIZE);
|
page_size = sysconf(_SC_PAGESIZE);
|
||||||
# else
|
#elif defined(_WINDOWS)
|
||||||
|
{
|
||||||
|
SYSTEM_INFO si;
|
||||||
|
GetSystemInfo(&si);
|
||||||
|
page_size = si.dwPageSize;
|
||||||
|
}
|
||||||
|
#else
|
||||||
# error Cannot get the page size on this platform
|
# error Cannot get the page size on this platform
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
AssignOrdinals();
|
AssignOrdinals();
|
||||||
|
|
|
@ -25,7 +25,6 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
#include "build.h"
|
#include "build.h"
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue