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 / **/ 25 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 */ 50 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: 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. 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_BODY 123 #define PERL_SYS_TERM_BODY() HINTS_REFCNT_TERM; OP_REFCNT_TERM; \ 124 PERLIO_TERM; MALLOC_TERM; CloseSTDLIB(); \ 125 PERL_LOCALE_TERM 126 127 #endif 128 129 #define BIT_BUCKET "NUL:" 130 131 #define dXSUB_SYS dNOOP 132 133 #define NO_ENVIRON_ARRAY 134 135 int kill(pid_t pid, int signo); 136 pid_t wait(int *status); 137 138 #ifdef PERL_GLOBAL_STRUCT_PRIVATE 139 # undef PERL_GET_VARS 140 # undef PERL_SET_VARS 141 # undef PERL_UNSET_VARS 142 # define PERL_GET_VARS() symbian_get_vars() 143 # define PERL_SET_VARS(v) symbian_set_vars(v) 144 # define PERL_UNSET_VARS(v) symbian_unset_vars() 145 #endif /* #ifdef PERL_GLOBAL_STRUCT_PRIVATE */ 146 147 #define PERL_CALLCONV EXPORT_C /* for proto.h */ 148 149 #ifndef PERL_CORE 150 #define PERL_CORE /* for WINS builds under VC */ 151 #endif 152 153 #ifdef USE_PERLIO 154 #define PERL_NEED_APPCTX /* need storing the PerlBase* */ 155 #define PERLIO_STD_SPECIAL 156 #define PERLIO_STD_IN(f, b, n) symbian_read_stdin(f, b, n) 157 #define PERLIO_STD_OUT(f, b, n) symbian_write_stdout(f, b, n) 158 /* The console (the STD*) streams are seen by Perl in UTF-8. */ 159 #define PERL_SYMBIAN_CONSOLE_UTF8 160 161 #endif 162 163 #undef Strerror 164 #undef strerror 165 #define Strerror(eno) ((eno) < 0 ? symbian_get_error_string(eno) : strerror(eno)) 166 167 #define PERL_NEED_TIMESBASE 168 169 #define times(b) symbian_times(b) 170 #define usleep(u) symbian_usleep(u) 171 172 #define PERL_SYS_INIT_BODY(c, v) symbian_sys_init(c, v) 173 174 #ifdef __SERIES60_1X__ 175 # error "Unfortunately Perl does not work in S60 1.2 (see FAQ-0929)" 176 #endif 177 178 #ifdef _MSC_VER 179 180 /* The Symbian SDK insists on the /W4 flag for Visual C. 181 * The Perl sources are not _that_ clean (Perl builds for Win32 use 182 * the /W3 flag, and gcc builds always use -Wall, so the sources are 183 * quite clean). To avoid a flood of warnings let's shut up most 184 * (for VC 6.0 SP 5). */ 185 186 #pragma warning(disable: 4054) /* function pointer to data pointer */ 187 #pragma warning(disable: 4055) /* data pointer to function pointer */ 188 #pragma warning(disable: 4100) /* unreferenced formal parameter */ 189 #pragma warning(disable: 4101) /* unreferenced local variable */ 190 #pragma warning(disable: 4102) /* unreferenced label */ 191 #pragma warning(disable: 4113) /* prototype difference */ 192 #pragma warning(disable: 4127) /* conditional expression is constant */ 193 #pragma warning(disable: 4132) /* const object should be initialized */ 194 #pragma warning(disable: 4133) /* incompatible types */ 195 #pragma warning(disable: 4189) /* initialized but not referenced */ 196 #pragma warning(disable: 4244) /* conversion from ... possible loss ... */ 197 #pragma warning(disable: 4245) /* signed/unsigned char */ 198 #pragma warning(disable: 4310) /* cast truncates constant value */ 199 #pragma warning(disable: 4505) /* function has been removed */ 200 #pragma warning(disable: 4510) /* default constructor could not ... */ 201 #pragma warning(disable: 4610) /* struct ... can never be instantiated */ 202 #pragma warning(disable: 4701) /* used without having been initialized */ 203 #pragma warning(disable: 4702) /* unreachable code */ 204 #pragma warning(disable: 4706) /* assignment within conditional */ 205 #pragma warning(disable: 4761) /* integral size mismatch */ 206 207 #endif /* _MSC_VER */ 208 209 #ifdef __MWERKS__ 210 /* No good way of using the CodeWarrior #pragma unused(varname) with Perl 211 * source code (e.g. PERL_UNUSED_DECL doesn't work with the pragma syntax). 212 * Therefore we brutally turn off these particular warnings since there 213 * is a lot of this in Perl code (pTHX, for example). TOther compilers 214 * will have to detect these naughty bits. */ 215 #pragma warn_unusedarg off 216 #pragma warn_unusedvar off 217 #pragma warn_emptydecl off 218 #endif 219