Regen Unicode tables to include a warning:
[p5sagit/p5-mst-13.2.git] / globals.c
1 #include "INTERN.h"
2 #define PERL_IN_GLOBALS_C
3 #include "perl.h"
4
5 #ifdef PERL_OBJECT
6
7 #undef PERLVAR
8 #define PERLVAR(x, y)
9 #undef PERLVARA
10 #define PERLVARA(x, n, y)
11 #undef PERLVARI
12 #define PERLVARI(x, y, z) PL_##x = z;
13 #undef PERLVARIC
14 #define PERLVARIC(x, y, z) PL_##x = z;
15
16 CPerlObj::CPerlObj(IPerlMem* ipM, IPerlEnv* ipE, IPerlStdIO* ipStd,
17                    IPerlLIO* ipLIO, IPerlDir* ipD, IPerlSock* ipS,
18                    IPerlProc* ipP)
19 {
20     memset(((char*)this)+sizeof(void*), 0, sizeof(CPerlObj)-sizeof(void*));
21
22 #include "thrdvar.h"
23 #include "intrpvar.h"
24 #include "perlvars.h"
25
26     PL_Mem = ipM;
27     PL_Env = ipE;
28     PL_StdIO = ipStd;
29     PL_LIO = ipLIO;
30     PL_Dir = ipD;
31     PL_Sock = ipS;
32     PL_Proc = ipP;
33 }
34
35 void*
36 CPerlObj::operator new(size_t nSize, IPerlMem *pvtbl)
37 {
38     if(pvtbl)
39         return pvtbl->pMalloc(pvtbl, nSize);
40 #ifndef __MINGW32__
41     /* operator new is supposed to throw std::bad_alloc */
42     return NULL;
43 #endif
44 }
45
46 void
47 CPerlObj::operator delete(void *pPerl, IPerlMem *pvtbl)
48 {
49     if(pvtbl)
50         pvtbl->pFree(pvtbl, pPerl);
51 }
52
53 void
54 CPerlObj::Init(void)
55 {
56 }
57
58 #ifdef WIN32            /* XXX why are these needed? */
59 bool
60 Perl_do_exec(char *cmd)
61 {
62     return PerlProc_Cmd(cmd);
63 }
64
65 int
66 CPerlObj::do_aspawn(void *vreally, void **vmark, void **vsp)
67 {
68     return PerlProc_aspawn(vreally, vmark, vsp);
69 }
70 #endif  /* WIN32 */
71
72 #endif   /* PERL_OBJECT */
73
74 int
75 Perl_fprintf_nocontext(PerlIO *stream, const char *format, ...)
76 {
77     dTHX;
78     va_list(arglist);
79     va_start(arglist, format);
80     return PerlIO_vprintf(stream, format, arglist);
81 }