diff --git a/dlls/gdi/enhmfdrv/graphics.c b/dlls/gdi/enhmfdrv/graphics.c index 3508ab7ff32..dd27f0672f8 100644 --- a/dlls/gdi/enhmfdrv/graphics.c +++ b/dlls/gdi/enhmfdrv/graphics.c @@ -18,6 +18,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "config.h" +#include "wine/port.h" + #include #include diff --git a/dlls/gdi/printdrv.c b/dlls/gdi/printdrv.c index 15ac5a58c36..0f9e2488d55 100644 --- a/dlls/gdi/printdrv.c +++ b/dlls/gdi/printdrv.c @@ -22,12 +22,16 @@ */ #include "config.h" +#include "wine/port.h" #include #include #include #include #include +#ifdef HAVE_IO_H +# include +#endif #ifdef HAVE_UNISTD_H # include #endif diff --git a/dlls/gdi/win16drv/init.c b/dlls/gdi/win16drv/init.c index b4b3d7ec70e..c579084590f 100644 --- a/dlls/gdi/win16drv/init.c +++ b/dlls/gdi/win16drv/init.c @@ -19,6 +19,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "config.h" +#include "wine/port.h" + #include #include #include diff --git a/dlls/kernel/comm.c b/dlls/kernel/comm.c index f990a2cae48..2cba3c6ce8a 100644 --- a/dlls/kernel/comm.c +++ b/dlls/kernel/comm.c @@ -74,7 +74,7 @@ #ifdef HAVE_UNISTD_H # include #endif -#ifdef HAVE_SYS_POOL_H +#ifdef HAVE_SYS_POLL_H # include #endif #ifdef HAVE_SYS_MODEM_H diff --git a/dlls/kernel/kernel_main.c b/dlls/kernel/kernel_main.c index 1a05ba188fb..ae4348522eb 100644 --- a/dlls/kernel/kernel_main.c +++ b/dlls/kernel/kernel_main.c @@ -19,6 +19,7 @@ */ #include "config.h" +#include "wine/port.h" #include #include diff --git a/dlls/kernel/locale.c b/dlls/kernel/locale.c index e34aff393af..15f84fcb016 100644 --- a/dlls/kernel/locale.c +++ b/dlls/kernel/locale.c @@ -443,7 +443,7 @@ static INT get_registry_locale_info( LPCWSTR value, LPWSTR buffer, INT len ) NTSTATUS status; UNICODE_STRING nameW; KEY_VALUE_PARTIAL_INFORMATION *info; - static const int info_size = info->Data - (UCHAR *)info; + static const int info_size = FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMATION, Data); if (RegOpenKeyExA( HKEY_CURRENT_USER, "Control Panel\\International", 0, KEY_READ, &hkey)) return -1; diff --git a/dlls/kernel/sync.c b/dlls/kernel/sync.c index 62b80cc50f9..2d7aca6475b 100644 --- a/dlls/kernel/sync.c +++ b/dlls/kernel/sync.c @@ -19,6 +19,7 @@ */ #include "config.h" +#include "wine/port.h" #include #ifdef HAVE_UNISTD_H diff --git a/dlls/kernel/thunk.c b/dlls/kernel/thunk.c index 3a2fb0d06df..c5fa10d8079 100644 --- a/dlls/kernel/thunk.c +++ b/dlls/kernel/thunk.c @@ -24,6 +24,7 @@ #include #include +#include #ifdef HAVE_UNISTD_H # include #endif diff --git a/dlls/kernel/wowthunk.c b/dlls/kernel/wowthunk.c index c223880bd96..845bb10e5ee 100644 --- a/dlls/kernel/wowthunk.c +++ b/dlls/kernel/wowthunk.c @@ -18,6 +18,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "config.h" +#include "wine/port.h" + #include "wine/winbase16.h" #include "winbase.h" #include "winerror.h" diff --git a/dlls/lzexpand/lzexpand_main.c b/dlls/lzexpand/lzexpand_main.c index 4a872f46b6a..ad7ec3d2a64 100644 --- a/dlls/lzexpand/lzexpand_main.c +++ b/dlls/lzexpand/lzexpand_main.c @@ -26,6 +26,7 @@ #include #include #include +#include #ifdef HAVE_UNISTD_H # include #endif diff --git a/dlls/ntdll/sec.c b/dlls/ntdll/sec.c index 12abd126fed..f4e45253542 100644 --- a/dlls/ntdll/sec.c +++ b/dlls/ntdll/sec.c @@ -19,6 +19,7 @@ */ #include "config.h" +#include "wine/port.h" #include #include diff --git a/dlls/ntdll/signal_powerpc.c b/dlls/ntdll/signal_powerpc.c index 8ece8008fa2..4db311032d0 100644 --- a/dlls/ntdll/signal_powerpc.c +++ b/dlls/ntdll/signal_powerpc.c @@ -27,7 +27,9 @@ #include #include #include -#include +#ifdef HAVE_UNISTD_H +# include +#endif #ifdef HAVE_SYS_PARAM_H # include diff --git a/dlls/shell32/dialogs.c b/dlls/shell32/dialogs.c index 13007a1f5ce..397ba8563c4 100644 --- a/dlls/shell32/dialogs.c +++ b/dlls/shell32/dialogs.c @@ -18,6 +18,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "config.h" +#include "wine/port.h" + #include #include #include "winerror.h" diff --git a/dlls/shell32/pidl.c b/dlls/shell32/pidl.c index 54f14208a3d..ad4a4abde2f 100644 --- a/dlls/shell32/pidl.c +++ b/dlls/shell32/pidl.c @@ -22,6 +22,9 @@ * */ +#include "config.h" +#include "wine/port.h" + #include #include #include diff --git a/dlls/shell32/shell.c b/dlls/shell32/shell.c index a380482a402..60207753703 100644 --- a/dlls/shell32/shell.c +++ b/dlls/shell32/shell.c @@ -20,6 +20,7 @@ */ #include "config.h" +#include "wine/port.h" #include #include diff --git a/dlls/shell32/shellpath.c b/dlls/shell32/shellpath.c index d6f5491d6f7..8531f6a9ea5 100644 --- a/dlls/shell32/shellpath.c +++ b/dlls/shell32/shellpath.c @@ -22,6 +22,10 @@ * Many of these functions are in SHLWAPI.DLL also * */ + +#include "config.h" +#include "wine/port.h" + #include #include #include "wine/debug.h" diff --git a/dlls/shlwapi/ordinal.c b/dlls/shlwapi/ordinal.c index a39eaf9aadc..680e2c73a29 100644 --- a/dlls/shlwapi/ordinal.c +++ b/dlls/shlwapi/ordinal.c @@ -20,6 +20,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "config.h" +#include "wine/port.h" + #include #include diff --git a/dlls/shlwapi/path.c b/dlls/shlwapi/path.c index 5d8e26cc091..cedc492fae6 100644 --- a/dlls/shlwapi/path.c +++ b/dlls/shlwapi/path.c @@ -19,6 +19,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "config.h" +#include "wine/port.h" + #include #include #include diff --git a/dlls/shlwapi/string.c b/dlls/shlwapi/string.c index 1c1cf9ec28f..45db4982032 100644 --- a/dlls/shlwapi/string.c +++ b/dlls/shlwapi/string.c @@ -19,6 +19,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "config.h" +#include "wine/port.h" + #include #include #include @@ -106,7 +109,7 @@ static BOOL WINAPI SHLWAPI_ChrCmpA(WORD ch1, WORD ch2) } /************************************************************************* - * ChrCmpIA [SHLWAPI.@] + * ChrCmpIA [SHLWAPI.385] * * Compare two characters, ignoring case. * @@ -136,7 +139,7 @@ static BOOL WINAPI SHLWAPI_ChrCmpW(WCHAR ch1, WCHAR ch2) } /************************************************************************* - * ChrCmpIW [SHLWAPI.@] + * ChrCmpIW [SHLWAPI.386] * * See ChrCmpIA. */ @@ -940,7 +943,7 @@ LPWSTR WINAPI StrDupW(LPCWSTR lpszStr) * Internal implementation of StrSpnA/StrCSpnA/StrCSpnIA */ static int WINAPI SHLWAPI_StrSpnHelperA(LPCSTR lpszStr, LPCSTR lpszMatch, - LPSTR WINAPI (*pStrChrFn)(LPCSTR,WORD), + LPSTR (WINAPI *pStrChrFn)(LPCSTR,WORD), BOOL bInvert) { LPCSTR lpszRead = lpszStr; @@ -966,7 +969,7 @@ static int WINAPI SHLWAPI_StrSpnHelperA(LPCSTR lpszStr, LPCSTR lpszMatch, * Internal implementation of StrSpnW/StrCSpnW/StrCSpnIW */ static int WINAPI SHLWAPI_StrSpnHelperW(LPCWSTR lpszStr, LPCWSTR lpszMatch, - LPWSTR WINAPI (*pStrChrFn)(LPCWSTR,WCHAR), + LPWSTR (WINAPI *pStrChrFn)(LPCWSTR,WCHAR), BOOL bInvert) { LPCWSTR lpszRead = lpszStr; diff --git a/graphics/painting.c b/graphics/painting.c index 8b095127856..2e359a9affd 100644 --- a/graphics/painting.c +++ b/graphics/painting.c @@ -20,6 +20,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "config.h" +#include "wine/port.h" + #include #include diff --git a/graphics/path.c b/graphics/path.c index 256e9e95540..bbca30af218 100644 --- a/graphics/path.c +++ b/graphics/path.c @@ -20,6 +20,7 @@ */ #include "config.h" +#include "wine/port.h" #include #include diff --git a/if1632/builtin.c b/if1632/builtin.c index d06b036424a..57742fee4a8 100644 --- a/if1632/builtin.c +++ b/if1632/builtin.c @@ -18,6 +18,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "config.h" +#include "wine/port.h" + #include #include #include diff --git a/if1632/relay.c b/if1632/relay.c index 159411c0e0d..899cfeec998 100644 --- a/if1632/relay.c +++ b/if1632/relay.c @@ -17,6 +17,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "config.h" +#include "wine/port.h" + #include #include #include diff --git a/include/file.h b/include/file.h index 51a859883d9..7e3563d0a66 100644 --- a/include/file.h +++ b/include/file.h @@ -22,7 +22,9 @@ #define __WINE_FILE_H #include /* time_t */ -#include +#ifdef HAVE_SYS_TIME_H +# include +#endif #include #include "winbase.h" #include "wine/windef16.h" /* HFILE16 */ diff --git a/include/rpcdcep.h b/include/rpcdcep.h index 6fe4bfac51e..91714079ea8 100644 --- a/include/rpcdcep.h +++ b/include/rpcdcep.h @@ -44,7 +44,7 @@ typedef struct _RPC_MESSAGE unsigned long RpcFlags; } RPC_MESSAGE, *PRPC_MESSAGE; -typedef void __RPC_STUB (*RPC_DISPATCH_FUNCTION)(PRPC_MESSAGE Message); +typedef void (__RPC_STUB *RPC_DISPATCH_FUNCTION)(PRPC_MESSAGE Message); typedef struct { diff --git a/library/config.c b/library/config.c index 350c1e05576..f4b8daba9a5 100644 --- a/library/config.c +++ b/library/config.c @@ -27,8 +27,9 @@ #include #include #include -#include - +#ifdef HAVE_UNISTD_H +# include +#endif #ifdef HAVE_PWD_H #include #endif diff --git a/loader/loadorder.c b/loader/loadorder.c index ee9e02cb098..61586b141de 100644 --- a/loader/loadorder.c +++ b/loader/loadorder.c @@ -19,6 +19,7 @@ */ #include "config.h" +#include "wine/port.h" #include #include diff --git a/loader/main.c b/loader/main.c index 88b2171761a..12dd29f74de 100644 --- a/loader/main.c +++ b/loader/main.c @@ -19,6 +19,7 @@ */ #include "config.h" +#include "wine/port.h" #include #include @@ -98,4 +99,3 @@ void WINAPI ExitKernel16( void ) WriteOutProfiles16(); TerminateProcess( GetCurrentProcess(), 0 ); } - diff --git a/loader/module.c b/loader/module.c index 9f409522b5b..854802cb02f 100644 --- a/loader/module.c +++ b/loader/module.c @@ -19,6 +19,7 @@ */ #include "config.h" +#include "wine/port.h" #include #include diff --git a/loader/ne/segment.c b/loader/ne/segment.c index 5678ee616bf..82950a8d777 100644 --- a/loader/ne/segment.c +++ b/loader/ne/segment.c @@ -20,6 +20,7 @@ */ #include "config.h" +#include "wine/port.h" #include #include diff --git a/loader/resource.c b/loader/resource.c index a4a5e610a78..f16d5d357f9 100644 --- a/loader/resource.c +++ b/loader/resource.c @@ -20,6 +20,7 @@ */ #include "config.h" +#include "wine/port.h" #include #include diff --git a/memory/registry.c b/memory/registry.c index 8280c0f34ef..5a2c5fe2c37 100644 --- a/memory/registry.c +++ b/memory/registry.c @@ -508,7 +508,7 @@ DWORD WINAPI RegQueryValueExW( HKEY hkey, LPCWSTR name, LPDWORD reserved, LPDWOR DWORD total_size; char buffer[256], *buf_ptr = buffer; KEY_VALUE_PARTIAL_INFORMATION *info = (KEY_VALUE_PARTIAL_INFORMATION *)buffer; - static const int info_size = info->Data - (UCHAR *)info; + static const int info_size = FIELD_OFFSET(KEY_VALUE_PARTIAL_INFORMATION, Data); TRACE("(0x%x,%s,%p,%p,%p,%p=%ld)\n", hkey, debugstr_w(name), reserved, type, data, count, count ? *count : 0 ); diff --git a/msdos/int11.c b/msdos/int11.c index bdcd34dc630..742eed008b3 100644 --- a/msdos/int11.c +++ b/msdos/int11.c @@ -19,6 +19,7 @@ */ #include "config.h" +#include "wine/port.h" #include #include diff --git a/msdos/int21.c b/msdos/int21.c index d4851e0657e..3f1761cc670 100644 --- a/msdos/int21.c +++ b/msdos/int21.c @@ -23,6 +23,7 @@ */ #include "config.h" +#include "wine/port.h" #include #include diff --git a/msdos/ioports.c b/msdos/ioports.c index f8e3b7c2c8e..f0e237ba35e 100644 --- a/msdos/ioports.c +++ b/msdos/ioports.c @@ -26,6 +26,7 @@ */ #include "config.h" +#include "wine/port.h" #include #include diff --git a/objects/font.c b/objects/font.c index 14548a56aac..2146fb18135 100644 --- a/objects/font.c +++ b/objects/font.c @@ -19,6 +19,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "config.h" +#include "wine/port.h" + #include #include #include diff --git a/relay32/builtin32.c b/relay32/builtin32.c index 5e9879b3c0d..8ef41eee9a9 100644 --- a/relay32/builtin32.c +++ b/relay32/builtin32.c @@ -19,6 +19,7 @@ */ #include "config.h" +#include "wine/port.h" #include #include diff --git a/scheduler/handle.c b/scheduler/handle.c index e24f0e2cdab..3e828fef416 100644 --- a/scheduler/handle.c +++ b/scheduler/handle.c @@ -22,6 +22,9 @@ #include #include +#ifdef HAVE_IO_H +# include +#endif #ifdef HAVE_UNISTD_H # include #endif diff --git a/scheduler/timer.c b/scheduler/timer.c index 578c0e9a6ef..210a1d28be7 100644 --- a/scheduler/timer.c +++ b/scheduler/timer.c @@ -18,6 +18,9 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ +#include "config.h" +#include "wine/port.h" + #include #include #include "winerror.h" diff --git a/win32/except.c b/win32/except.c index a13f1350b20..def3bb7401c 100644 --- a/win32/except.c +++ b/win32/except.c @@ -35,6 +35,8 @@ * documented! * */ +#include "config.h" +#include "wine/port.h" #include #include "windef.h"