From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29337 invoked by alias); 28 May 2007 19:59:53 -0000 Received: (qmail 29328 invoked by uid 22791); 28 May 2007 19:59:53 -0000 X-Spam-Check-By: sourceware.org Received: from mail.gmx.net (HELO mail.gmx.net) (213.165.64.20) by sourceware.org (qpsmtpd/0.31) with SMTP; Mon, 28 May 2007 19:59:51 +0000 Received: (qmail invoked by alias); 28 May 2007 19:59:48 -0000 Received: from dslb-088-065-080-119.pools.arcor-ip.net (EHLO [192.168.0.64]) [88.65.80.119] by mail.gmx.net (mp049) with SMTP; 28 May 2007 21:59:48 +0200 X-Authenticated: #2206523 Message-ID: <465B34FA.2010902@gmx.de> Date: Tue, 29 May 2007 12:36:00 -0000 From: Marc Peter User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 To: pthreads-win32@sourceware.org Subject: OpenWatcom 1.6 passes tests with DLL build Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-IsSubscribed: yes Mailing-List: contact pthreads-win32-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: pthreads-win32-owner@sourceware.org X-SW-Source: 2007/txt/msg00030.txt.bz2 Hi, I've managed to build a DLL version of the library with Open Watcom 1.6 which passes all tests after only slight modifications to the source. I used the CVS sources. Here is a short summary of the changes I made: - use the -br compiler switch for both the library and the tests This is necessary so both, library and application, use the same run-time library instance. This fixes the errno problem mentioned in README.Watcom.[1] - enable inclusion of Open Watcom has int64_t in this header. - define PTW32_CDECL to be empty This prevents compilation errors in tests, where calling conventions for callbacks don't match. This could also have been fixed by using proxy functions for the callbacks in the tests, but I went for the quick fix.[2] - use #pragma aux syntax for inline assembly This is more efficient then _asm { ... } syntax and doesn't require to disable any compiler warnings. - fix Wamekefile in the "tests" directory Some extensions in the PASSES variable were missing. The patch is 225 lines long, my experimental make file has another 22 lines. If it is okay with the policy of this list, I can attach them in another message. Note: The "Wmakefile" mentioned in README.Watcom was nowhere to be found. I have not performed any regression tests with other compilers, but I don't expect any incompatibilities. best regards Marc [1] As soon as a thread is started, the CRT must behave slightly different, for instance lock concurrently used resources such as the heap during malloc/free calls. This is the reason why new threads must be created with a CRT function like _beginthread(ex), and not by calling the Win32 API directly. [2] __cdecl was only chosen so a DLL created with Open Watcom can be used with different compilers. But mixing runtime libraries of different compilers is another step further towards "interesting" behavior than using two instances of the same CRT - see errno problem. So, if we restrict the DLL to be only used with Watcom generated applications, we can safely use register based calling.