This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re:ext/threads/t/problem.t (was: Problems with mod_perl 1.12 (?) and ActivePerl 5...
[perl5.git] / ext / XS / APItest / APItest.xs
... / ...
CommitLineData
1#include "EXTERN.h"
2#include "perl.h"
3#include "XSUB.h"
4
5MODULE = XS::APItest PACKAGE = XS::APItest
6
7PROTOTYPES: DISABLE
8
9void
10print_double(val)
11 double val
12 CODE:
13 printf("%5.3f\n",val);
14
15int
16have_long_double()
17 CODE:
18#ifdef HAS_LONG_DOUBLE
19 RETVAL = 1;
20#else
21 RETVAL = 0;
22#endif
23 OUTPUT:
24 RETVAL
25
26void
27print_long_double()
28 CODE:
29#ifdef HAS_LONG_DOUBLE
30# if defined(PERL_PRIfldbl) && (LONG_DOUBLESIZE > DOUBLESIZE)
31 long double val = 7.0;
32 printf("%5.3" PERL_PRIfldbl "\n",val);
33# else
34 double val = 7.0;
35 printf("%5.3f\n",val);
36# endif
37#endif
38
39void
40print_int(val)
41 int val
42 CODE:
43 printf("%d\n",val);
44
45void
46print_long(val)
47 long val
48 CODE:
49 printf("%ld\n",val);
50
51void
52print_float(val)
53 float val
54 CODE:
55 printf("%5.3f\n",val);
56
57void
58print_flush()
59 CODE:
60 fflush(stdout);