Alexandre Julliard : include: Don't include wine/port.h in Unix libraries.
Alexandre Julliard
julliard at winehq.org
Wed Nov 3 16:42:01 CDT 2021
Module: wine
Branch: master
Commit: ef6e33f89f94e1fc109bb6c415d7c80f141619d5
URL: https://source.winehq.org/git/wine.git/?a=commit;h=ef6e33f89f94e1fc109bb6c415d7c80f141619d5
Author: Alexandre Julliard <julliard at winehq.org>
Date: Wed Nov 3 10:43:50 2021 +0100
include: Don't include wine/port.h in Unix libraries.
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/bcrypt/gnutls.c | 3 ++-
dlls/dwrite/freetype.c | 4 +++-
dlls/kerberos/unixlib.c | 5 ++++-
dlls/netapi32/unixlib.c | 7 ++-----
dlls/odbc32/unixlib.c | 3 ++-
dlls/secur32/schannel_gnutls.c | 3 ++-
dlls/win32u/dibdrv/opengl.c | 4 +++-
dlls/win32u/freetype.c | 7 +++----
dlls/winebus.sys/bus_iohid.c | 2 +-
dlls/winebus.sys/bus_sdl.c | 8 ++++----
include/wine/port.h | 4 ++++
11 files changed, 30 insertions(+), 20 deletions(-)
diff --git a/dlls/bcrypt/gnutls.c b/dlls/bcrypt/gnutls.c
index 863b47f50eb..d7b4499c692 100644
--- a/dlls/bcrypt/gnutls.c
+++ b/dlls/bcrypt/gnutls.c
@@ -23,13 +23,14 @@
#endif
#include "config.h"
-#include "wine/port.h"
#ifdef HAVE_GNUTLS_CIPHER_INIT
#include <stdarg.h>
#include <stdlib.h>
#include <assert.h>
+#include <sys/types.h>
+#include <dlfcn.h>
#include <gnutls/gnutls.h>
#include <gnutls/crypto.h>
#include <gnutls/abstract.h>
diff --git a/dlls/dwrite/freetype.c b/dlls/dwrite/freetype.c
index ca29b0d97bd..1ece99e08c9 100644
--- a/dlls/dwrite/freetype.c
+++ b/dlls/dwrite/freetype.c
@@ -23,7 +23,9 @@
#endif
#include "config.h"
-#include "wine/port.h"
+
+#include <sys/types.h>
+#include <dlfcn.h>
#ifdef HAVE_FT2BUILD_H
#include <ft2build.h>
diff --git a/dlls/kerberos/unixlib.c b/dlls/kerberos/unixlib.c
index cceb99b2b36..a735a1c6a47 100644
--- a/dlls/kerberos/unixlib.c
+++ b/dlls/kerberos/unixlib.c
@@ -26,10 +26,13 @@
#endif
#include "config.h"
+
#if defined(SONAME_LIBKRB5) && defined(SONAME_LIBGSSAPI_KRB5)
-#include "wine/port.h"
#include <stdarg.h>
+#include <sys/types.h>
+#include <dlfcn.h>
+
#ifdef HAVE_KRB5_KRB5_H
# include <krb5/krb5.h>
#endif
diff --git a/dlls/netapi32/unixlib.c b/dlls/netapi32/unixlib.c
index 0c86b619c99..4e77808cb86 100644
--- a/dlls/netapi32/unixlib.c
+++ b/dlls/netapi32/unixlib.c
@@ -24,7 +24,6 @@
#endif
#include "config.h"
-#include "wine/port.h"
#ifdef SONAME_LIBNETAPI
@@ -32,12 +31,10 @@
#include <stdlib.h>
#include <fcntl.h>
#include <errno.h>
-#ifdef HAVE_SYS_WAIT_H
+#include <sys/types.h>
#include <sys/wait.h>
-#endif
-#ifdef HAVE_UNISTD_H
#include <unistd.h>
-#endif
+#include <dlfcn.h>
#include "ntstatus.h"
#define WIN32_NO_STATUS
diff --git a/dlls/odbc32/unixlib.c b/dlls/odbc32/unixlib.c
index 4bc8708f486..8458406d8c0 100644
--- a/dlls/odbc32/unixlib.c
+++ b/dlls/odbc32/unixlib.c
@@ -29,10 +29,11 @@
#endif
#include "config.h"
-#include "wine/port.h"
#include <stdarg.h>
#include <stdlib.h>
+#include <sys/types.h>
+#include <dlfcn.h>
#include "ntstatus.h"
#define WIN32_NO_STATUS
diff --git a/dlls/secur32/schannel_gnutls.c b/dlls/secur32/schannel_gnutls.c
index b817a37c4a4..5f7ea3842a0 100644
--- a/dlls/secur32/schannel_gnutls.c
+++ b/dlls/secur32/schannel_gnutls.c
@@ -24,12 +24,13 @@
#endif
#include "config.h"
-#include "wine/port.h"
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
+#include <sys/types.h>
+#include <dlfcn.h>
#ifdef SONAME_LIBGNUTLS
#include <gnutls/gnutls.h>
#include <gnutls/crypto.h>
diff --git a/dlls/win32u/dibdrv/opengl.c b/dlls/win32u/dibdrv/opengl.c
index 9504e8efd25..5d3ee471497 100644
--- a/dlls/win32u/dibdrv/opengl.c
+++ b/dlls/win32u/dibdrv/opengl.c
@@ -23,7 +23,9 @@
#endif
#include "config.h"
-#include "wine/port.h"
+
+#include <sys/types.h>
+#include <dlfcn.h>
#include "ntstatus.h"
#define WIN32_NO_STATUS
diff --git a/dlls/win32u/freetype.c b/dlls/win32u/freetype.c
index 70415d8a157..3894478a846 100644
--- a/dlls/win32u/freetype.c
+++ b/dlls/win32u/freetype.c
@@ -26,14 +26,13 @@
#endif
#include "config.h"
-#include "wine/port.h"
#include <stdarg.h>
#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
#include <fcntl.h>
-#ifdef HAVE_SYS_STAT_H
-# include <sys/stat.h>
-#endif
+#include <dlfcn.h>
#ifdef HAVE_SYS_MMAN_H
# include <sys/mman.h>
#endif
diff --git a/dlls/winebus.sys/bus_iohid.c b/dlls/winebus.sys/bus_iohid.c
index 4412a4bf6dd..eef882b52e8 100644
--- a/dlls/winebus.sys/bus_iohid.c
+++ b/dlls/winebus.sys/bus_iohid.c
@@ -22,9 +22,9 @@
#endif
#include "config.h"
-#include "wine/port.h"
#include <stdarg.h>
+#include <sys/types.h>
#if defined(HAVE_IOKIT_HID_IOHIDLIB_H)
#define DWORD UInt32
diff --git a/dlls/winebus.sys/bus_sdl.c b/dlls/winebus.sys/bus_sdl.c
index d172d5382fd..c01648ce67e 100644
--- a/dlls/winebus.sys/bus_sdl.c
+++ b/dlls/winebus.sys/bus_sdl.c
@@ -23,14 +23,14 @@
#endif
#include "config.h"
-#include "wine/port.h"
+
#include <errno.h>
#include <fcntl.h>
#include <stdarg.h>
#include <stdlib.h>
-#ifdef HAVE_UNISTD_H
-# include <unistd.h>
-#endif
+#include <unistd.h>
+#include <sys/types.h>
+#include <dlfcn.h>
#ifdef HAVE_SDL_H
# include <SDL.h>
#endif
diff --git a/include/wine/port.h b/include/wine/port.h
index 694032a33bc..0405b8d63ad 100644
--- a/include/wine/port.h
+++ b/include/wine/port.h
@@ -29,6 +29,10 @@
# error You must include port.h before all other headers
#endif
+#ifdef WINE_UNIX_LIB
+# error port.h should not be used in Unix libraries
+#endif
+
#include <sys/types.h>
More information about the wine-cvs
mailing list