This is the mail archive of the cygwin-patches mailing list for the Cygwin project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
On Wed, Oct 05, 2011 at 11:17:58PM +0200, Christian Franke wrote:Christopher Faylor wrote:On Wed, Oct 05, 2011 at 12:57:44PM +0200, Christian Franke wrote:Why is this necessary? It doesn't look like it is ever expanded in cygwin/wait.h.... diff --git a/winsup/cygwin/include/cygwin/wait.h b/winsup/cygwin/include/cygwin/wait.h index bed81b7..e4edba2 100644 --- a/winsup/cygwin/include/cygwin/wait.h +++ b/winsup/cygwin/include/cygwin/wait.h @@ -1,6 +1,6 @@ /* cygwin/wait.h
- Copyright 2006, 2009 Red Hat, Inc. + Copyright 2006, 2009, 2011 Red Hat, Inc.
This file is part of Cygwin.
@@ -16,6 +16,9 @@ details. */ #define WCONTINUED 8 #define __W_CONTINUED 0xffff
+/* Will be redefined in sys/wait.h. */ +#define __wait_status_to_int(w) (w) +This would be needed if cygwin/wait.h is included separately without sys/wait.h (e.g. stdlib.h -> cygwin/stdlib.h -> cygwin/wait.h) and some W*() macro is actually used.
If a redefinition is necessary why not put it all in one place?The W*() macros and union wait are closely related. So a probably better approach would be to move union wait to cygwin/wait.h and define __wait_status_to_int() only there.
But then C++ compile may fail because cygwin/wait.h is sometimes included indirectly inside an extern "C" block: w32api/shlobj.h -> extern "C" { w32api/ole2.h ...-> stdlib.h ...-> cygwin/wait.h }Ok. I see that Linux's use of similar macros is convoluted too. I really would rather keep this all together but I guess it isn't possible without redesigning stdlib.h and */wait.h.
typedef void *__wait_status_ptr_t; #define __wait_status_to_int(w) (*(int*)&(w))
// w32api/shlobj.h: extern "C" { #include ... ... // cygwin/wait.h: ... #ifdef __cplusplus extern "C++" { inline int __wait_status_to_int(int __status) { .... } inline int __wait_status_to_int(const union wait &__status) { .... } } #endif
Also since Cygwin is C++ why do you need the __INSIDE_CYGWIN__ here?There are still ten *.c files in winsup/cygwin :-)% cd winsup/cygwin % grep wait.h **/*.c %
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |