This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Document the unportability of atan2() edge cases
[perl5.git] / perlapi.c
1 /*
2  *    perlapi.c
3  *
4  *    Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999,
5  *    2000, 2001, 2002, 2003, 2004, 2005, by Larry Wall and others
6  *
7  *    You may distribute under the terms of either the GNU General Public
8  *    License or the Artistic License, as specified in the README file.
9  *
10  * !!!!!!!   DO NOT EDIT THIS FILE   !!!!!!!
11  * This file is built by embed.pl from data in embed.fnc, embed.pl,
12  * pp.sym, intrpvar.h, perlvars.h and thrdvar.h.
13  * Any changes made here will be lost!
14  *
15  * Edit those files and run 'make regen_headers' to effect changes.
16  *
17  *
18  * Up to the threshold of the door there mounted a flight of twenty-seven
19  * broad stairs, hewn by some unknown art of the same black stone.  This
20  * was the only entrance to the tower.
21  *
22  */
23
24 #include "EXTERN.h"
25 #include "perl.h"
26 #include "perlapi.h"
27
28 #if defined (MULTIPLICITY)
29
30 /* accessor functions for Perl variables (provides binary compatibility) */
31 START_EXTERN_C
32
33 #undef PERLVAR
34 #undef PERLVARA
35 #undef PERLVARI
36 #undef PERLVARIC
37 #undef PERLVARISC
38
39 #define PERLVAR(v,t)    t* Perl_##v##_ptr(pTHX)                         \
40                         { dVAR; return &(aTHX->v); }
41 #define PERLVARA(v,n,t) PL_##v##_t* Perl_##v##_ptr(pTHX)                \
42                         { dVAR; return &(aTHX->v); }
43
44 #define PERLVARI(v,t,i) PERLVAR(v,t)
45 #define PERLVARIC(v,t,i) PERLVAR(v, const t)
46 #define PERLVARISC(v,i) PL_##v##_t* Perl_##v##_ptr(pTHX)                \
47                         { dVAR; return &(aTHX->v); }
48
49 #include "thrdvar.h"
50 #include "intrpvar.h"
51
52 #undef PERLVAR
53 #undef PERLVARA
54 #define PERLVAR(v,t)    t* Perl_##v##_ptr(pTHX)                         \
55                         { dVAR; return &(PL_##v); }
56 #define PERLVARA(v,n,t) PL_##v##_t* Perl_##v##_ptr(pTHX)                \
57                         { dVAR; return &(PL_##v); }
58 #undef PERLVARIC
59 #undef PERLVARISC
60 #define PERLVARIC(v,t,i)        \
61                         const t* Perl_##v##_ptr(pTHX)           \
62                         { return (const t *)&(PL_##v); }
63 #define PERLVARISC(v,i) PL_##v##_t* Perl_##v##_ptr(pTHX)        \
64                         { dVAR; return &(PL_##v); }
65 #include "perlvars.h"
66
67 #undef PERLVAR
68 #undef PERLVARA
69 #undef PERLVARI
70 #undef PERLVARIC
71 #undef PERLVARISC
72
73 #ifndef PERL_GLOBAL_STRUCT
74 /* A few evil special cases.  Could probably macrofy this. */
75 #undef PL_ppaddr
76 #undef PL_check
77 #undef PL_fold_locale
78 Perl_ppaddr_t** Perl_Gppaddr_ptr(pTHX) {
79     static const Perl_ppaddr_t* ppaddr_ptr = PL_ppaddr;
80     return (Perl_ppaddr_t**)&ppaddr_ptr;
81 }
82 Perl_check_t**  Perl_Gcheck_ptr(pTHX) {
83     static const Perl_check_t* check_ptr  = PL_check;
84     return (Perl_check_t**)&check_ptr;
85 }
86 unsigned char** Perl_Gfold_locale_ptr(pTHX) {
87     static const unsigned char* fold_locale_ptr = PL_fold_locale;
88     return (unsigned char**)&fold_locale_ptr;
89 }
90 #endif
91
92 END_EXTERN_C
93
94 #endif /* MULTIPLICITY */