1Watcom compiler notes
2=====================
3
4Status
5------
6Not yet usable. Although the library builds under Watcom it
7substantially fails the test suite.
8
9There is a working Wmakefile for wmake for the library build.
10
11invoke as any of:
12wmake -f Wmakefile clean WC
13wmake -f Wmakefile clean WC-inlined
14wmake -f Wmakefile clean WCE
15wmake -f Wmakefile clean WCE-inlined
16
17These build pthreadWC.dll and pthreadWCE.dll.
18
19There is a working Wmakefile for wmake for the test suite.
20
21invoke as any of:
22wmake -f Wmakefile clean WC
23wmake -f Wmakefile clean WCX
24wmake -f Wmakefile clean WCE
25wmake -f Wmakefile clean WC-bench
26wmake -f Wmakefile clean WCX-bench
27wmake -f Wmakefile clean WCE-bench
28
29
30Current known problems
31----------------------
32
33Library build:
34The Watcom compiler uses a different default call convention to MS C or GNU C and so
35applications are not compatible with pthreadVC.dll etc using pre 2003-10-14 versions
36of pthread.h, sched.h, or semaphore.h. The cdecl attribute can be used on exposed
37function prototypes to force compatibility with MS C built DLLs.
38
39However, there appear to be other incompatibilities. Errno.h, for example, defines
40different values for the standard C and POSIX errors to those defined by the MS C
41errno.h. It may be that references to Watcom's threads compatible 'errno' do set
42and return translated numbers consistently, but I have not verified this.
43
44Watcom defines errno as a dereferenced pointer returned by the function
45_get_errno_ptr(). This is similar to both the MS and GNU C environments for
46multithreaded use. However, the Watcom version appears to have a number of problems:
47
48- different threads return the same pointer value. Compare with the MS and GNU C
49versions which correctly return different values (since each thread must maintain
50a thread specific errno value).
51
52- an errno value set within the DLL appears as zero in the application even though
53both share the same thread.
54
55Therefore applications built using the Watcom compiler may need to use
56a Watcom built version of the library (pthreadWC.dll). If this is the case, then
57the cdecl function attribute should not be required.
58
59Application builds:
60The test suite fails with the Watcom compiler.
61
62Test semaphore1.c fails for pthreadWC.dll because errno returns 0 instead of EAGAIN.
63