This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Module::Load::Conditional 0.18 (was Re: Module::Load::Conditional 0.18 wannabe)
[perl5.git] / symbian / symbianish.h
CommitLineData
27da23d5
JH
1/*
2 * symbianish.h
3 *
4 * Copyright (c) Nokia 2004-2005. All rights reserved.
5 * This code is licensed under the same terms as Perl itself.
6 *
7 */
8
9#include "symbian/symbian_port.h"
10
11/*
12 * The following symbols are defined if your operating system supports
13 * functions by that name. All Unixes I know of support them, thus they
14 * are not checked by the configuration script, but are directly defined
15 * here.
16 */
17
18#ifndef PERL_MICRO
19
20/* HAS_IOCTL:
21 * This symbol, if defined, indicates that the ioctl() routine is
22 * available to set I/O characteristics
23 */
24#define HAS_IOCTL / **/
d1dd14d1 25
27da23d5
JH
26/* HAS_UTIME:
27 * This symbol, if defined, indicates that the routine utime() is
28 * available to update the access and modification times of files.
29 */
30/* #define HAS_UTIME / **/
31
32/* HAS_GROUP
33 * This symbol, if defined, indicates that the getgrnam() and
34 * getgrgid() routines are available to get group entries.
35 * The getgrent() has a separate definition, HAS_GETGRENT.
36 */
37#undef HAS_GROUP /**/
38
39/* HAS_PASSWD
40 * This symbol, if defined, indicates that the getpwnam() and
41 * getpwuid() routines are available to get password entries.
42 * The getpwent() has a separate definition, HAS_GETPWENT.
43 */
44#undef HAS_PASSWD /**/
45
46#undef HAS_KILL
47#undef HAS_WAIT
48
49#endif /* !PERL_MICRO */
d1dd14d1 50
27da23d5
JH
51/* USEMYBINMODE
52 * This symbol, if defined, indicates that the program should
53 * use the routine my_binmode(FILE *fp, char iotype) to insure
54 * that a file is in "binary" mode -- that is, that no translation
55 * of bytes occurs on read or write operations.
56 */
57#undef USEMYBINMODE
58
59/* Stat_t:
60 * This symbol holds the type used to declare buffers for information
61 * returned by stat(). It's usually just struct stat. It may be necessary
62 * to include <sys/stat.h> and <sys/types.h> to get any typedef'ed
63 * information.
64 */
65#define Stat_t struct stat
66
67/* USE_STAT_RDEV:
68 * This symbol is defined if this system has a stat structure declaring
69 * st_rdev
70 */
71#define USE_STAT_RDEV /**/
72
73/* ACME_MESS:
d1dd14d1 74 * This symbol, if defined, indicates that error messages should be
27da23d5
JH
75 * should be generated in a format that allows the use of the Acme
76 * GUI/editor's autofind feature.
77 */
78#undef ACME_MESS /**/
79
80/* UNLINK_ALL_VERSIONS:
81 * This symbol, if defined, indicates that the program should arrange
82 * to remove all versions of a file if unlink() is called. This is
83 * probably only relevant for VMS.
84 */
85/* #define UNLINK_ALL_VERSIONS / **/
86
87/* VMS:
88 * This symbol, if defined, indicates that the program is running under
89 * VMS. It is currently automatically set by cpps running under VMS,
90 * and is included here for completeness only.
91 */
92/* #define VMS / **/
93
94/* ALTERNATE_SHEBANG:
95 * This symbol, if defined, contains a "magic" string which may be used
96 * as the first line of a Perl program designed to be executed directly
97 * by name, instead of the standard Unix #!. If ALTERNATE_SHEBANG
98 * begins with a character other then #, then Perl will only treat
99 * it as a command line if it finds the string "perl" in the first
100 * word; otherwise it's treated as the first line of code in the script.
101 * (IOW, Perl won't hand off to another interpreter via an alternate
102 * shebang sequence that might be legal Perl code.)
103 */
104/* #define ALTERNATE_SHEBANG "#!" / **/
105
106#include <signal.h>
107#define ABORT() abort()
108
109/*
110 * fwrite1() should be a routine with the same calling sequence as fwrite(),
111 * but which outputs all of the bytes requested as a single stream (unlike
112 * fwrite() itself, which on some systems outputs several distinct records
113 * if the number_of_items parameter is >1).
114 */
115#define fwrite1 fwrite
116
117#define Stat(fname,bufptr) stat((fname),(bufptr))
118#define Fstat(fd,bufptr) fstat((fd),(bufptr))
119#define Fflush(fp) fflush(fp)
120#define Mkdir(path,mode) mkdir((path),(mode))
121
122#ifndef PERL_SYS_TERM
3890ecea 123#define PERL_SYS_TERM() HINTS_REFCNT_TERM; OP_REFCNT_TERM; PERLIO_TERM; MALLOC_TERM; CloseSTDLIB();
27da23d5
JH
124#endif
125
126#define BIT_BUCKET "NUL:"
127
128#define dXSUB_SYS
129
130#define NO_ENVIRON_ARRAY
131
132int kill(pid_t pid, int signo);
133pid_t wait(int *status);
134
135#ifdef PERL_GLOBAL_STRUCT_PRIVATE
136# undef PERL_GET_VARS
137# undef PERL_SET_VARS
138# undef PERL_UNSET_VARS
139# define PERL_GET_VARS() symbian_get_vars()
140# define PERL_SET_VARS(v) symbian_set_vars(v)
141# define PERL_UNSET_VARS(v) symbian_unset_vars()
142#endif /* #ifdef PERL_GLOBAL_STRUCT_PRIVATE */
143
144#undef PERL_EXPORT_C
145#define PERL_EXPORT_C EXPORT_C /* for perlio.h */
d0d72822 146#define PERL_CALLCONV EXPORT_C /* for proto.h */
27da23d5
JH
147#undef PERL_XS_EXPORT_C
148#define PERL_XS_EXPORT_C EXPORT_C
149
150#ifndef PERL_CORE
151#define PERL_CORE /* for WINS builds under VC */
152#endif
153
154#ifdef USE_PERLIO
155#define PERL_NEED_APPCTX /* need storing the PerlBase* */
156#define PERLIO_STD_SPECIAL
157#define PERLIO_STD_IN(f, b, n) symbian_read_stdin(f, b, n)
158#define PERLIO_STD_OUT(f, b, n) symbian_write_stdout(f, b, n)
159/* The console (the STD*) streams are seen by Perl in UTF-8. */
160#define PERL_SYMBIAN_CONSOLE_UTF8
161
162#endif
163
164#undef Strerror
165#undef strerror
166#define Strerror(eno) ((eno) < 0 ? symbian_get_error_string(eno) : strerror(eno))
167
168#define PERL_NEED_TIMESBASE
169
170#define times(b) symbian_times(b)
171#define usleep(u) symbian_usleep(u)
172
173#define PERL_SYS_INIT(c, v) symbian_sys_init(c, v)
174
175#ifdef __SERIES60_1X__
176# error "Unfortunately Perl does not work in S60 1.2 (see FAQ-0929)"
177#endif
178
179#ifdef _MSC_VER
180
181/* The Symbian SDK insists on the /W4 flag for Visual C.
182 * The Perl sources are not _that_ clean (Perl builds for Win32 use
183 * the /W3 flag, and gcc builds always use -Wall, so the sources are
184 * quite clean). To avoid a flood of warnings let's shut up most
185 * (for VC 6.0 SP 5). */
186
187#pragma warning(disable: 4054) /* function pointer to data pointer */
188#pragma warning(disable: 4055) /* data pointer to function pointer */
189#pragma warning(disable: 4100) /* unreferenced formal parameter */
190#pragma warning(disable: 4101) /* unreferenced local variable */
191#pragma warning(disable: 4102) /* unreferenced label */
192#pragma warning(disable: 4113) /* prototype difference */
193#pragma warning(disable: 4127) /* conditional expression is constant */
194#pragma warning(disable: 4132) /* const object should be initialized */
195#pragma warning(disable: 4133) /* incompatible types */
196#pragma warning(disable: 4189) /* initialized but not referenced */
197#pragma warning(disable: 4244) /* conversion from ... possible loss ... */
198#pragma warning(disable: 4245) /* signed/unsigned char */
199#pragma warning(disable: 4310) /* cast truncates constant value */
200#pragma warning(disable: 4505) /* function has been removed */
201#pragma warning(disable: 4510) /* default constructor could not ... */
202#pragma warning(disable: 4610) /* struct ... can never be instantiated */
203#pragma warning(disable: 4701) /* used without having been initialized */
204#pragma warning(disable: 4702) /* unreachable code */
205#pragma warning(disable: 4706) /* assignment within conditional */
206#pragma warning(disable: 4761) /* integral size mismatch */
207
208#endif /* _MSC_VER */
209
1215b447
JH
210#ifdef __MWERKS__
211/* No good way of using the CodeWarrior #pragma unused(varname) with Perl
212 * source code (e.g. PERL_UNUSED_DECL doesn't work with the pragma syntax).
213 * Therefore we brutally turn off these particular warnings since there
214 * is a lot of this in Perl code (pTHX, for example). TOther compilers
215 * will have to detect these naughty bits. */
216#pragma warn_unusedarg off
217#pragma warn_unusedvar off
218#pragma warn_emptydecl off
219#endif