4 * Copyright (c) Nokia 2004-2005. All rights reserved.
5 * This code is licensed under the same terms as Perl itself.
9 #include "symbian/symbian_port.h"
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
21 * This symbol, if defined, indicates that the ioctl() routine is
22 * available to set I/O characteristics
24 #define HAS_IOCTL / **/
27 * This symbol, if defined, indicates that the routine utime() is
28 * available to update the access and modification times of files.
30 /* #define HAS_UTIME / **/
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.
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.
44 #undef HAS_PASSWD /**/
49 #endif /* !PERL_MICRO */
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.
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
65 #define Stat_t struct stat
68 * This symbol is defined if this system has a stat structure declaring
71 #define USE_STAT_RDEV /**/
74 * This symbol, if defined, indicates that error messages should be
75 * should be generated in a format that allows the use of the Acme
76 * GUI/editor's autofind feature.
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.
85 /* #define UNLINK_ALL_VERSIONS / **/
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.
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.)
104 /* #define ALTERNATE_SHEBANG "#!" / **/
107 #define ABORT() abort()
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).
115 #define fwrite1 fwrite
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))
122 #ifndef PERL_SYS_TERM_BODY
123 #define PERL_SYS_TERM_BODY() HINTS_REFCNT_TERM; OP_REFCNT_TERM; \
124 PERLIO_TERM; MALLOC_TERM; CloseSTDLIB();
127 #define BIT_BUCKET "NUL:"
131 #define NO_ENVIRON_ARRAY
133 int kill(pid_t pid, int signo);
134 pid_t wait(int *status);
136 #ifdef PERL_GLOBAL_STRUCT_PRIVATE
137 # undef PERL_GET_VARS
138 # undef PERL_SET_VARS
139 # undef PERL_UNSET_VARS
140 # define PERL_GET_VARS() symbian_get_vars()
141 # define PERL_SET_VARS(v) symbian_set_vars(v)
142 # define PERL_UNSET_VARS(v) symbian_unset_vars()
143 #endif /* #ifdef PERL_GLOBAL_STRUCT_PRIVATE */
146 #define PERL_EXPORT_C EXPORT_C /* for perlio.h */
147 #define PERL_CALLCONV EXPORT_C /* for proto.h */
148 #undef PERL_XS_EXPORT_C
149 #define PERL_XS_EXPORT_C EXPORT_C
152 #define PERL_CORE /* for WINS builds under VC */
156 #define PERL_NEED_APPCTX /* need storing the PerlBase* */
157 #define PERLIO_STD_SPECIAL
158 #define PERLIO_STD_IN(f, b, n) symbian_read_stdin(f, b, n)
159 #define PERLIO_STD_OUT(f, b, n) symbian_write_stdout(f, b, n)
160 /* The console (the STD*) streams are seen by Perl in UTF-8. */
161 #define PERL_SYMBIAN_CONSOLE_UTF8
167 #define Strerror(eno) ((eno) < 0 ? symbian_get_error_string(eno) : strerror(eno))
169 #define PERL_NEED_TIMESBASE
171 #define times(b) symbian_times(b)
172 #define usleep(u) symbian_usleep(u)
174 #define PERL_SYS_INIT_BODY(c, v) symbian_sys_init(c, v)
176 #ifdef __SERIES60_1X__
177 # error "Unfortunately Perl does not work in S60 1.2 (see FAQ-0929)"
182 /* The Symbian SDK insists on the /W4 flag for Visual C.
183 * The Perl sources are not _that_ clean (Perl builds for Win32 use
184 * the /W3 flag, and gcc builds always use -Wall, so the sources are
185 * quite clean). To avoid a flood of warnings let's shut up most
186 * (for VC 6.0 SP 5). */
188 #pragma warning(disable: 4054) /* function pointer to data pointer */
189 #pragma warning(disable: 4055) /* data pointer to function pointer */
190 #pragma warning(disable: 4100) /* unreferenced formal parameter */
191 #pragma warning(disable: 4101) /* unreferenced local variable */
192 #pragma warning(disable: 4102) /* unreferenced label */
193 #pragma warning(disable: 4113) /* prototype difference */
194 #pragma warning(disable: 4127) /* conditional expression is constant */
195 #pragma warning(disable: 4132) /* const object should be initialized */
196 #pragma warning(disable: 4133) /* incompatible types */
197 #pragma warning(disable: 4189) /* initialized but not referenced */
198 #pragma warning(disable: 4244) /* conversion from ... possible loss ... */
199 #pragma warning(disable: 4245) /* signed/unsigned char */
200 #pragma warning(disable: 4310) /* cast truncates constant value */
201 #pragma warning(disable: 4505) /* function has been removed */
202 #pragma warning(disable: 4510) /* default constructor could not ... */
203 #pragma warning(disable: 4610) /* struct ... can never be instantiated */
204 #pragma warning(disable: 4701) /* used without having been initialized */
205 #pragma warning(disable: 4702) /* unreachable code */
206 #pragma warning(disable: 4706) /* assignment within conditional */
207 #pragma warning(disable: 4761) /* integral size mismatch */
209 #endif /* _MSC_VER */
212 /* No good way of using the CodeWarrior #pragma unused(varname) with Perl
213 * source code (e.g. PERL_UNUSED_DECL doesn't work with the pragma syntax).
214 * Therefore we brutally turn off these particular warnings since there
215 * is a lot of this in Perl code (pTHX, for example). TOther compilers
216 * will have to detect these naughty bits. */
217 #pragma warn_unusedarg off
218 #pragma warn_unusedvar off
219 #pragma warn_emptydecl off