3 # Create threads safe wrappers around X11 calls.
5 # Copyright 1998 Kristian Nielsen.
8 # FIXME: This does not do full C prototype parsing, but relies on
9 # knowledge on how the X11 include files are formatted. It will
10 # probably need to be modified for new include files. It also fails
11 # for certain prototypes (notably those with function pointer
12 # arguments or results), so these must be added manually. And it
13 # relies on a fixed location of X11 includes (/usr/X11R6/include/).
15 # This program expects to be run from Wine's main directory.
17 $X11_include_dir = "/usr/X11/include";
19 $wantfile = "$outdir/X11_calls";
20 @dolist = ("Xlib", "Xresource", "Xutil", "xpm", "XShm", "xf86dga", "xf86dga2", "xf86vmode", "shape", "xvideo", "Xrender");
22 # First read list of wanted function names.
24 open(WANT, $wantfile) || die "open";
26 next if /^\s*\#/; # Skip comment lines.
27 next if /^\s*$/; # Skip empty lines.
28 if(/^\s*([a-zA-Z0-9_]+)\s*$/) {
31 die "syntax error in file '$wantfile', in line '$_'";
36 foreach $name (@dolist) {
41 $outfile = "/ts_$lcname";
42 open(OUTC, ">$outdir/$outfile.c") || die "open";
43 open(OUTH, ">include/$outfile.h") || die "open";
50 if($name eq "Xutil" || $name eq "Xresource" || $name eq "XShm") {
51 $x11_incl = "#include <X11/Xlib.h>\n";
52 # For Xutil, we need X11/Xresource.h for XUniqueContext().
53 $x11_incl .= "#include <X11/Xresource.h>\n" if $name eq "Xutil";
55 if($name eq "xf86dga") {
56 $x11_incl = "#include <X11/Xlib.h>\n";
57 $extensions_dir = "extensions/";
58 $pre_file = "#ifdef HAVE_LIBXXF86DGA\n";
59 $post_file = "#endif /* defined(HAVE_LIBXXF86DGA) */\n";
61 if($name eq "xf86dga2") {
62 $x11_incl = "#include <X11/Xlib.h>\n";
63 $extensions_dir = "extensions/";
64 $pre_file = "#ifdef HAVE_LIBXXF86DGA2\n";
65 $post_file = "#endif /* defined(HAVE_LIBXXF86DGA2) */\n";
66 $inc_name = "xf86dga";
69 $extensions_dir = "extensions/";
70 $pre_file = "#ifdef HAVE_LIBXXSHM\n";
71 $post_file = "#endif /* defined(HAVE_LIBXXSHM) */\n";
74 $pre_file = "#ifdef HAVE_LIBXXPM\n";
75 $post_file = "#endif /* defined(HAVE_LIBXXPM) */\n";
77 if($name eq "xf86vmode") {
78 $x11_incl = "#include <X11/Xlib.h>\n";
79 $extensions_dir = "extensions/";
80 $pre_file = "#include \"windef.h\"\n#ifdef HAVE_LIBXXF86VM\n#define XMD_H\n#include \"basetsd.h\"\n";
81 $post_file = "#endif /* defined(HAVE_LIBXXF86VM) */\n";
83 if($name eq "shape") {
84 $extensions_dir = "extensions/";
85 $pre_file = "#ifdef HAVE_LIBXSHAPE\n#include <X11/IntrinsicP.h>\n";
86 $post_file = "#endif /* defined(HAVE_LIBXSHAPE) */\n";
89 if($name eq "xvideo") {
90 $x11_incl = "#include <X11/Xlib.h>\n#include <X11/extensions/Xv.h>\n#include <X11/extensions/XShm.h>\n";
91 $extensions_dir = "extensions/";
92 $pre_file = "#ifdef HAVE_XVIDEO\n";
93 $post_file = "#endif /* defined(HAVE_XVIDEO) */\n";
96 if($name eq "Xrender") {
97 $x11_incl = "#include <X11/Xlib.h>\n";
98 $extensions_dir = "extensions/";
99 $pre_file = "#ifdef HAVE_LIBXRENDER\n";
100 $post_file = "#endif /* defined(HAVE_LIBXRENDER) */\n";
106 * Thread safe wrappers around $name calls.
107 * Always include this file instead of <X11/$name.h>.
108 * This file was generated automatically by tools/make_X11wrappers
112 #ifndef __WINE_TS_$ucname\_H
113 #define __WINE_TS_$ucname\_H
115 #ifndef __WINE_CONFIG_H
116 # error You must include config.h to use this header
120 $x11_incl#include <X11/$extensions_dir$inc_name.h>
122 extern void (*wine_tsx11_lock)(void);
123 extern void (*wine_tsx11_unlock)(void);
129 * Thread safe wrappers around $name calls.
130 * This file was generated automatically by tools/make_X11wrappers
137 $x11_incl#include <X11/$extensions_dir$inc_name.h>
139 #include "ts_$lcname.h"
143 if($name eq "xpm") { # Handle as special case.
144 output_fn("XpmCreatePixmapFromData", "int",
145 "Display *, Drawable, char **, Pixmap *, Pixmap *, XpmAttributes *",
146 "Display *a0, Drawable a1, char **a2, Pixmap *a3, Pixmap *a4, XpmAttributes *a5",
147 "a0, a1, a2, a3, a4, a5");
148 output_fn("XpmAttributesSize", "int", "void", "void", "");
149 } elsif($name eq "XShm") {
150 output_fn("XShmQueryExtension", "Bool",
151 "Display *", "Display *a0", "a0");
152 output_fn("XShmQueryVersion", "Bool",
153 "Display *, int *, int *, Bool *",
154 "Display *a0, int *a1, int *a2, Bool *a3", "a0, a1, a2, a3");
155 output_fn("XShmPixmapFormat", "int",
156 "Display *", "Display *a0", "a0");
157 output_fn("XShmAttach", Status,
158 "Display *, XShmSegmentInfo *",
159 "Display *a0, XShmSegmentInfo *a1", "a0, a1");
160 output_fn("XShmDetach", Status,
161 "Display *, XShmSegmentInfo *",
162 "Display *a0, XShmSegmentInfo *a1", "a0, a1");
163 output_fn("XShmPutImage", Status,
164 "Display *, Drawable, GC, XImage *, int, int, int, int, unsigned int, unsigned int, Bool",
165 "Display *a0, Drawable a1, GC a2, XImage *a3, int a4, int a5, int a6, int a7, unsigned int a8, unsigned int a9, Bool a10", "a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10");
166 output_fn("XShmGetImage", Status,
167 "Display *, Drawable, XImage *, int, int, unsigned long",
168 "Display *a0, Drawable a1, XImage *a2, int a3, int a4, unsigned long a5",
169 "a0, a1, a2, a3, a4, a5");
170 output_fn("XShmCreateImage", "XImage *",
171 "Display *, Visual *, unsigned int, int, char *, XShmSegmentInfo *, unsigned int, unsigned int",
172 "Display *a0, Visual *a1, unsigned int a2, int a3, char *a4, XShmSegmentInfo *a5, unsigned int a6, unsigned int a7",
173 "a0, a1, a2, a3, a4, a5, a6, a7");
174 output_fn("XShmCreatePixmap", "Pixmap",
175 "Display *, Drawable, char *, XShmSegmentInfo *, unsigned int, unsigned int, unsigned int",
176 "Display *a0, Drawable a1, char *a2, XShmSegmentInfo *a3, unsigned int a4, unsigned int a5, unsigned int a6",
177 "a0, a1, a2, a3, a4, a5, a6");
178 } elsif($name eq "xf86dga") {
179 output_fn("XF86DGAQueryVersion",Bool,
180 "Display*,int*,int*",
181 "Display*a0,int*a1,int*a2",
184 output_fn("XF86DGAQueryExtension",Bool,
185 "Display*,int*,int*",
186 "Display*a0,int*a1,int*a2",
189 output_fn("XF86DGAGetVideo",Status,
190 "Display*,int,char**,int*,int*,int*",
191 "Display*a0,int a1,char**a2,int*a3,int*a4,int*a5",
194 output_fn("XF86DGADirectVideo",Status,
196 "Display*a0,int a1,int a2",
199 output_fn("XF86DGAGetViewPortSize",Status,
200 "Display*,int,int*,int*",
201 "Display*a0,int a1,int *a2,int *a3",
204 output_fn("XF86DGASetViewPort",Status,
205 "Display*,int,int,int",
206 "Display*a0,int a1,int a2,int a3",
209 output_fn("XF86DGAInstallColormap",Status,
210 "Display*,int,Colormap",
211 "Display*a0,int a1,Colormap a2",
214 output_fn("XF86DGAQueryDirectVideo",Status,
216 "Display*a0,int a1,int *a2",
219 output_fn("XF86DGAViewPortChanged",Status,
221 "Display*a0,int a1,int a2",
224 } elsif($name eq "xf86dga2") {
225 output_fn_short("Bool", "XDGAQueryVersion", "Display*" ,"int*","int*");
226 output_fn_short("Bool", "XDGAQueryExtension", "Display*" ,"int*","int*");
227 output_fn_short("XDGAMode*", "XDGAQueryModes", "Display*" ,"int", "int*");
228 output_fn_short("XDGADevice*", "XDGASetMode", "Display*" ,"int","int");
229 output_fn_short("Bool", "XDGAOpenFramebuffer", "Display*" ,"int");
230 output_fn_short("void", "XDGACloseFramebuffer", "Display*" ,"int");
231 output_fn_short("void", "XDGASetViewport", "Display*" ,"int", "int", "int", "int");
232 output_fn_short("void", "XDGAInstallColormap", "Display*" , "int", "Colormap");
233 output_fn_short("Colormap", "XDGACreateColormap", "Display*" ,"int", "XDGADevice*", "int");
234 output_fn_short("void", "XDGASelectInput", "Display*" ,"int", "long");
235 output_fn_short("void", "XDGAFillRectangle", "Display*" ,"int", "int", "int", "unsigned int", "unsigned int", "unsigned long");
236 output_fn_short("void", "XDGACopyArea", "Display*" ,"int", "int", "int", "unsigned int", "unsigned int", "int", "int");
237 output_fn_short("void", "XDGACopyTransparentArea", "Display*" ,"int", "int", "int", "unsigned int", "unsigned int", "int", "int", "unsigned long");
238 output_fn_short("int", "XDGAGetViewportStatus", "Display*" ,"int");
239 output_fn_short("void", "XDGASync", "Display*" ,"int");
240 output_fn_short("Bool", "XDGASetClientVersion", "Display*");
241 output_fn_short("void", "XDGAChangePixmapMode", "Display*" ,"int", "int*", "int*", "int");
242 output_fn_short("void", "XDGAKeyEventToXKeyEvent", "XDGAKeyEvent*" ,"XKeyEvent*");
243 } elsif ($name eq "xvideo") {
244 output_fn_short("int", "XvQueryExtension", "Display*", "unsigned int*", "unsigned int*", "unsigned int*", "unsigned int*", "unsigned int*");
245 output_fn_short("int", "XvQueryAdaptors", "Display*", "Window", "unsigned int*", "XvAdaptorInfo**");
246 output_fn_short("int", "XvQueryEncodings", "Display*", "XvPortID", "unsigned int*", "XvEncodingInfo**");
247 output_fn_short("int", "XvPutVideo", "Display*", "XvPortID", "Drawable", "GC", "int", "int", "unsigned int", "unsigned int", "int", "int", "unsigned int", "unsigned int");
248 output_fn_short("int", "XvPutStill", "Display*", "XvPortID", "Drawable", "GC", "int", "int", "unsigned int", "unsigned int", "int", "int", "unsigned int", "unsigned int");
249 output_fn_short("int", "XvGetVideo", "Display*", "XvPortID", "Drawable", "GC", "int", "int", "unsigned int", "unsigned int", "int", "int", "unsigned int", "unsigned int");
250 output_fn_short("int", "XvGetStill", "Display*", "XvPortID", "Drawable", "GC", "int", "int", "unsigned int", "unsigned int", "int", "int", "unsigned int", "unsigned int");
251 output_fn_short("int", "XvStopVideo", "Display*", "XvPortID", "Drawable");
252 output_fn_short("int", "XvGrabPort", "Display*", "XvPortID", "Time");
253 output_fn_short("int", "XvUngrabPort", "Display*", "XvPortID", "Time");
254 output_fn_short("int", "XvSelectVideoNotify", "Display*", "Drawable", "Bool");
255 output_fn_short("int", "XvSelectPortNotify", "Display*", "XvPortID", "Bool");
256 output_fn_short("int", "XvSetPortAttribute", "Display*", "XvPortID", "Atom", "int");
257 output_fn_short("int", "XvGetPortAttribute", "Display*", "XvPortID", "Atom", "int*");
258 output_fn_short("int", "XvQueryBestSize", "Display*", "XvPortID", "Bool", "unsigned int", "unsigned int", "unsigned int", "unsigned int", "unsigned int*", "unsigned int*");
259 output_fn_short("XvAttribute*", "XvQueryPortAttributes", "Display*", "XvPortID", "int*");
260 output_fn_short("void", "XvFreeAdaptorInfo", "XvAdaptorInfo*");
261 output_fn_short("void", "XvFreeEncodingInfo", "XvEncodingInfo*");
262 output_fn_short("XvImageFormatValues *", "XvListImageFormats", "Display*", "XvPortID", "int*");
263 output_fn_short("XvImage *", "XvCreateImage", "Display*", "XvPortID", "int", "char*", "int", "int");
264 output_fn_short("int", "XvPutImage", "Display*", "XvPortID", "Drawable", "GC", "XvImage*", "int", "int", "unsigned int", "unsigned int", "int", "int", "unsigned int", "unsigned int");
265 output_fn_short("int", "XvShmPutImage", "Display*", "XvPortID", "Drawable", "GC", "XvImage*", "int", "int", "unsigned int", "unsigned int", "int", "int", "unsigned int", "unsigned int", "Bool");
266 output_fn_short("XvImage *", "XvShmCreateImage", "Display*", "XvPortID", "int", "char*", "int", "int", "XShmSegmentInfo*");
267 } elsif($name eq "xf86vmode") {
268 output_fn("XF86VidModeQueryVersion",Bool,
269 "Display*,int*,int*",
270 "Display*a0,int*a1,int*a2",
273 output_fn("XF86VidModeQueryExtension",Bool,
274 "Display*,int*,int*",
275 "Display*a0,int*a1,int*a2",
278 output_fn("XF86VidModeGetModeLine",Bool,
279 "Display*,int,int*,XF86VidModeModeLine*",
280 "Display*a0,int a1,int*a2,XF86VidModeModeLine*a3",
283 output_fn("XF86VidModeGetAllModeLines",Bool,
284 "Display*,int,int*,XF86VidModeModeInfo***",
285 "Display*a0,int a1,int*a2,XF86VidModeModeInfo***a3",
288 output_fn("XF86VidModeAddModeLine",Bool,
289 "Display*,int,XF86VidModeModeInfo*,XF86VidModeModeInfo*",
290 "Display*a0,int a1,XF86VidModeModeInfo*a2,XF86VidModeModeInfo*a3",
293 output_fn("XF86VidModeDeleteModeLine",Bool,
294 "Display*,int,XF86VidModeModeInfo*",
295 "Display*a0,int a1,XF86VidModeModeInfo*a2",
298 output_fn("XF86VidModeModModeLine",Bool,
299 "Display*,int,XF86VidModeModeLine*",
300 "Display*a0,int a1,XF86VidModeModeLine*a2",
303 output_fn("XF86VidModeValidateModeLine",Status,
304 "Display*,int,XF86VidModeModeInfo*",
305 "Display*a0,int a1,XF86VidModeModeInfo*a2",
308 output_fn("XF86VidModeSwitchMode",Bool,
310 "Display*a0,int a1,int a2",
313 output_fn("XF86VidModeSwitchToMode",Bool,
314 "Display*,int,XF86VidModeModeInfo*",
315 "Display*a0,int a1,XF86VidModeModeInfo*a2",
318 output_fn("XF86VidModeLockModeSwitch",Bool,
320 "Display*a0,int a1,int a2",
323 output_fn("XF86VidModeGetMonitor",Bool,
324 "Display*,int,XF86VidModeMonitor*",
325 "Display*a0,int a1,XF86VidModeMonitor*a2",
328 output_fn("XF86VidModeGetViewPort",Bool,
329 "Display*,int,int*,int*",
330 "Display*a0,int a1,int*a2,int*a3",
333 output_fn("XF86VidModeSetViewPort",Bool,
334 "Display*,int,int,int",
335 "Display*a0,int a1,int a2,int a3",
338 } elsif($name eq "Xrender") {
339 output_fn("XRenderAddGlyphs","void",
340 "Display*,GlyphSet,Glyph*,XGlyphInfo*,int,char*,int",
341 "Display*a0,GlyphSet a1,Glyph*a2,XGlyphInfo*a3,int a4,char*a5,int a6",
342 "a0,a1,a2,a3,a4,a5,a6"
344 output_fn("XRenderCompositeString8","void",
345 "Display*,int,Picture,Picture,XRenderPictFormat*,GlyphSet,int,int,int,int,char*,int",
346 "Display*a0,int a1,Picture a2,Picture a3,XRenderPictFormat*a4,GlyphSet a5,int a6,int a7,int a8,int a9,char*a10,int a11",
347 "a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11"
349 output_fn("XRenderCompositeString16","void",
350 "Display*,int,Picture,Picture,XRenderPictFormat*,GlyphSet,int,int,int,int,unsigned short*,int",
351 "Display*a0,int a1,Picture a2,Picture a3,XRenderPictFormat*a4,GlyphSet a5,int a6,int a7,int a8,int a9,unsigned short*a10,int a11",
352 "a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11"
354 output_fn("XRenderCompositeString32","void",
355 "Display*,int,Picture,Picture,XRenderPictFormat*,GlyphSet,int,int,int,int,unsigned int*,int",
356 "Display*a0,int a1,Picture a2,Picture a3,XRenderPictFormat*a4,GlyphSet a5,int a6,int a7,int a8,int a9,unsigned int*a10,int a11",
357 "a0,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11"
359 output_fn("XRenderCreateGlyphSet",GlyphSet,
360 "Display*,XRenderPictFormat*",
361 "Display*a0,XRenderPictFormat*a1",
364 output_fn("XRenderCreatePicture",Picture,
365 "Display*,Drawable,XRenderPictFormat*,unsigned long,XRenderPictureAttributes*",
366 "Display*a0,Drawable a1,XRenderPictFormat*a2,unsigned long a3,XRenderPictureAttributes*a4",
369 output_fn("XRenderFillRectangle","void",
370 "Display*,int,Picture,XRenderColor*,int,int,unsigned int, unsigned int",
371 "Display*a0,int a1,Picture a2,XRenderColor*a3,int a4,int a5,unsigned int a6,unsigned int a7",
372 "a0,a1,a2,a3,a4,a5,a6,a7"
374 output_fn("XRenderFindFormat","XRenderPictFormat*",
375 "Display*,unsigned long,XRenderPictFormat*,int",
376 "Display*a0,unsigned long a1,XRenderPictFormat*a2,int a3",
379 output_fn("XRenderFindVisualFormat","XRenderPictFormat*",
381 "Display*a0,Visual*a1",
384 output_fn("XRenderFreeGlyphSet","void",
386 "Display*a0,GlyphSet a1",
389 output_fn("XRenderFreePicture","void",
391 "Display*a0,Picture a1",
394 output_fn("XRenderSetPictureClipRectangles","void",
395 "Display*,Picture,int,int,XRectangle*,int",
396 "Display*a0,Picture a1,int a2,int a3,XRectangle* a4,int a5",
399 output_fn("XRenderQueryExtension",Bool,
400 "Display*,int*,int*",
401 "Display*a0,int*a1,int*a2",
407 "echo \"$x11_incl#include <X11/$extensions_dir$name.h>\" | " .
408 "gcc -L$X11_include_dir -DNeedFunctionPrototypes -E - | " .
409 "grep -v '^[ \t]*\$)' |"
413 if(m'extern\s+([^()]*)\b([a-zA-Z0-9_]+)\s*\(') {
416 $result_type = "int" if $result_type =~ /^\s*$/;
420 # Give up on vararg functions and function pointer args.
421 if(m'\.\.\.|\(\*\)') {
425 if(m'\s*([^,]*[^, \t])\s*(,?\n)') {
426 $args[$#args+1] = $1;
427 if ($1 =~ /char\s*\[/) { # small hack for XQueryKeymap
428 $args[$#args] = "char*";
432 # Skip if vararg, function pointer arg, or not needed.
433 next unless $fn_name;
434 next unless $want{$fn_name} && $want{$fn_name} == 1;
436 # Special case for no arguments (which is specified as "void").
437 if($#args == 0 && $args[0] eq "void") {
443 for($i = 0; $i <= $#args; $i++) {
444 $comma = $i < $#args ? ", " : "";
445 $proto .= "$args[$i]$comma";
446 $formals .= "$args[$i] a$i$comma";
447 $actuals .= "a$i$comma";
449 $proto = $formals = "void" if $#args == -1;
450 output_fn($fn_name, $result_type, $proto, $formals, $actuals);
455 if($name eq "Xlib") {
456 raw_output_fn("XSynchronize", "int (*r)(Display *)",
457 "int (*TSXSynchronize(Display *, Bool))(Display *)",
458 "int (*TSXSynchronize(Display *a0, Bool a1))(Display *)",
460 print OUTC "\nextern void _XInitImageFuncPtrs(XImage *);\n";
461 output_fn("_XInitImageFuncPtrs", "void", "XImage *", "XImage *a0", "a0");
462 } elsif($name eq "Xutil") {
463 output_fn("XDestroyImage", "int",
464 "struct _XImage *", "struct _XImage *a0", "a0");
465 output_fn("XGetPixel", "unsigned long",
466 "struct _XImage *, int, int",
467 "struct _XImage *a0, int a1, int a2",
469 output_fn("XPutPixel", "int",
470 "struct _XImage *, int, int, unsigned long",
471 "struct _XImage *a0, int a1, int a2, unsigned long a3",
473 output_fn("XSubImage", "struct _XImage *",
474 "struct _XImage *, int, int, unsigned int, unsigned int",
475 "struct _XImage *a0, int a1, int a2, unsigned int a3, unsigned int a4",
476 "a0, a1, a2, a3, a4");
477 output_fn("XAddPixel", "int",
478 "struct _XImage *, long",
479 "struct _XImage *a0, long a1", "a0, a1");
480 output_fn("XUniqueContext", "XContext", "void", "void", "");
481 output_fn("XDeleteContext", "int",
482 "Display*,XID,XContext",
483 "Display*a0,XID a1,XContext a2",
490 #endif /* __WINE_TS_$ucname\_H */
501 foreach $i (keys %want) {
503 print "Unresolved: $i\n";
510 # output_fn("main", "int", "int, char **", "int a0, char **a1", "a0, a1")
513 my ($fn_name, $result_type, $protos, $formals, $actuals) = @_;
515 return raw_output_fn($fn_name,
516 $result_type =~ /^\s*void\s*$/ ? "" : "$result_type r",
517 "$result_type TS$fn_name($protos)",
518 "$result_type TS$fn_name($formals)",
522 sub output_fn_short {
524 # output_fn_sort("Bool", "XDGAQueryExtension", "Display *", "int *", "int *");
526 my ($result_type, $fn_name, @args) = @_;
528 my ($i, $proto, $formals, $actuals) = (0,
529 "$result_type TS$fn_name(",
530 "$result_type TS$fn_name(",
532 while ($val = shift @args) {
533 $proto = $proto . $val;
534 $formals = $formals . $val . " a$i";
535 $actuals = $actuals . " a$i";
538 $proto = $proto . ", ";
539 $formals = $formals . ", ";
540 $actuals = $actuals . ", ";
543 $proto = $proto . ")";
544 $formals = $formals . ")";
547 raw_output_fn($fn_name,
548 $result_type =~ /^\s*void\s*$/ ? "" : "$result_type r",
556 # output_fn("main", "int r", "int main(int, char **)", "int main(int a0, char **a1)", "a0, a1")
559 my ($fn_name, $resultdecl, $protodecl, $defdecl, $actuals) = @_;
561 return undef unless $want{$fn_name} && $want{$fn_name} == 1;
563 print OUTC "\n$defdecl\n";
564 print OUTH "extern $protodecl;\n";
565 # print OUTH "#define $fn_name TS$fn_name\n";
567 print OUTC " $resultdecl;\n" if $resultdecl;
568 print OUTC " wine_tsx11_lock();\n";
570 print OUTC "r = " if $resultdecl;
571 print OUTC "$fn_name($actuals);\n";
572 print OUTC " wine_tsx11_unlock();\n";
573 print OUTC " return r;\n" if $resultdecl;