Issue an error if port.h is included after the regular Wine headers.

Francois Gouget fgouget at
Tue May 22 11:12:05 CDT 2007


I have noticed a post on wine-devel that pointed out a bug in a patch: 
port.h was included after other headers. There probably is not much we 
can do about the system headers, but essentially all Wine headers need 
to include basetsd.h first (usually via windef.h -> winnt.h). So we 
could detect when port.h is included after a Wine header and issue an 
error. That should reduce the risk of getting bad patches due to this 
issue. As an added bonus it will also fix the issue with config.h.

 include/wine/port.h |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/include/wine/port.h b/include/wine/port.h
index 8861408..6ab0627 100644
--- a/include/wine/port.h
+++ b/include/wine/port.h
@@ -25,6 +25,10 @@
 # error You must include config.h to use this header
+#ifdef __WINE_BASETSD_H
+# error You must include port.h before all other headers
 #define _FILE_OFFSET_BITS 64
 #define _GNU_SOURCE  /* for pread/pwrite */
 #include <fcntl.h>

More information about the wine-patches mailing list