Thanks OK lets start with an oldy Just to see if I get the tools right:
<patch> see attachment </patch>
should I embed or attach?
some explanations: The original Idea was proposed by Ove Kaaven (see __declspec(selectany) thread in wine-devel) The original Idea did not go so well because in lots of places these __declspecs would be again #defined by code and that #define 3-level indirection would confuse the compiler. Also this way one can see what is supported and what is not. I am afraid that I only checked that code compiles but did not write test cases where these constructs are usefully. (Also pretty_com.h & uuidof.h will come soon)
IMPORTANT the above and other patches I will submit later are all, let's call them: Microsoft Extensions to the C/C++ compiler. they are currently scattered in a few headers here and also in msvcrt. (like wchar_t). I think WINE headers should, presuppose, and stay clean of "Microsoft Extensions" functionality and stay close to MS-headers as possible. All "Microsoft Extensions" should go into a special header and be included where needed like here. (windef.h)
What do people think? should I go and collect all extensions to one header and remove them from where they currently are? This is also good for when one would need to compile with a compiler other than gcc.
Dimitrie O. Paun wrote:
On December 29, 2003 01:36 am, Boaz Harrosh wrote:
I have successfully Beta released a WinLib port of a, 1 million lines of code, windows program. QA will Install a first Linux Machine and will start to bang on it tomorrow. (Well more like an advanced Alfa I guess)
Congratulations indeed!
Tomorrow I will start synchronization with wine current tree. Once I have it synced (2 days max). I will need someone to help me and guide me on how to send it all in. Dimi, will that be you?
Sure, why not. The best way I think is to post them to wine-patches (if you're fairly sure about the patches), and people will comment. If you are unsure, post to wine-devel first, we'll refine the patches there before they go to wine-patches.
? 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 08:04:32 -0000 @@ -113,14 +113,44 @@ #define FAR __ONLY_IN_WINELIB() #endif
+ #ifndef _MSC_VER + +// works well. Some times the exact placing veries with in the statment +#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 paralle defined to nothing +#define __declspec_novtable +// Gcc only suports code ?? +#define __declspec_allocate(segname) __attribute__ (( section(segname) )) + +// property is supported thrugh 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 + # ifndef _declspec -# define _declspec(x) __ONLY_IN_WINELIB() +# define _declspec(x) __declspec_##x # endif # ifndef __declspec -# define __declspec(x) __ONLY_IN_WINELIB() +# define __declspec(x) __declspec_##x # endif -#endif + +#endif //_MSC_VER
#define CALLBACK __stdcall #define WINAPI __stdcall