Dimitrie O. Paun wrote:
Please embed if you can, it makes it so much easier to comment on the code.
And let the mozzila spell-check code comments :)
A few comments: -- please don't use C++ comments (//...), use C comments instead (/* ... */)
Done
-- these things are defined by winegcc as well, we should protect them with #ifndef, otherwise we'll get a lot of warnings when building with winegcc
they were/are protected, but I think it should be removed from winegcc because they don't do the Job. If you accept my proposal of ms-extensions.h collecting all these, and cleaning up wine headers, than winegcc could do: "-include ms-extensions.h" to take care of all extensions in one command line switch. (It can also give people using winegcc the freedom of what is defined). What is your opinion of an ms-extensions.h file? you didn't say.
-- these things should not be available while building Wine, we should use the __ONLY_IN_WINELIB() like so: # define __declspec(x) __ONLY_IN_WINELIB(__declspec_##x)
Please don't do: # define __declspec(x) __ONLY_IN_WINELIB(__declspec_##x) it will break things. See if my fix is good enough if not we can do an #else
<patch>
? windef.diff ? wine.kdevelop Index: include/windef.h =================================================================== RCS file: /home/wine/wine/include/windef.h,v retrieving revision 1.89 diff -u -r1.89 windef.h --- include/windef.h 24 Sep 2003 05:26:00 -0000 1.89 +++ include/windef.h 31 Dec 2003 09:15:15 -0000 @@ -113,14 +113,44 @@ #define FAR __ONLY_IN_WINELIB() #endif
+ #ifndef _MSC_VER -# ifndef _declspec -# define _declspec(x) __ONLY_IN_WINELIB() + +/* works well. Some times the exact placing varies with in the statement */ +#define __declspec_selectany __attribute__((weak)) +/* ignored by GCC and is warned (supported by MinGW) */ +#define __declspec_dllexport __attribute__((dllexport)) +/* ignored by GCC and is warned (supported by MinGW) */ +#define __declspec_dllimport __attribute__((dllimport)) +/* works */ +#define __declspec_noreturn __attribute__ ((noreturn)) +/* works */ +#define __declspec_nothrow __attribute__ ((nothrow)) +/* works ?? */ +#define __declspec_naked __attribute__ ((naked)) + +/* GCC is more restrictive about placing. look for TLS in gcc & msdn documentation */ +#define __declspec_thread __thread +/* no parallel defined to nothing */ +#define __declspec_novtable +/* Gcc only supports code ?? */ +#define __declspec_allocate(segname) __attribute__ (( section(segname) )) + +/* property is supported through the file pretty_com.h */ +/* property( get=get_func_name|, put=put_func_name ) */ + +/* _declspec( uuid() ) and __uuidof are supported with code changes */ +/* see uuidof.h */ +#define __declspec_uuid(ComObjectGUID) error_SEE__uuidof_h__for_use_of_uuid + +# if !defined(_declspec) && !defined (__WINESRC__) +# define _declspec(x) __declspec_##x # endif -# ifndef __declspec -# define __declspec(x) __ONLY_IN_WINELIB() +# if !defined(_declspec) && !defined (__WINESRC__) +# define __declspec(x) __declspec_##x # endif -#endif + +#endif //_MSC_VER
#define CALLBACK __stdcall #define WINAPI __stdcall
</patch>
Free Life Boaz