Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Symbian port of Perl

Message-ID: <B356D8F434D20B40A8CEDAEC305A1F2453D653@esebe105.NOE.Nokia.com>

p4raw-id: //depot/perl@24271
  • Loading branch information...
commit 27da23d53ccce622bc51822f59df8def79b4df95 1 parent ec06242
@jhi jhi authored rgs committed
Showing with 7,688 additions and 750 deletions.
  1. +2 −2 EXTERN.h
  2. +18 −18 INTERN.h
  3. +33 −0 MANIFEST
  4. +7 −0 Porting/curliff.pl
  5. +6 −0 Porting/makerel
  6. +352 −0 README.symbian
  7. +6 −1 XSUB.h
  8. +5 −0 av.c
  9. +1 −0  bytecode.pl
  10. +7 −2 configpm
  11. +11 −9 doio.c
  12. +13 −13 dump.c
  13. +8 −3 embed.fnc
  14. +10 −2 embed.h
  15. +52 −9 embed.pl
  16. +78 −15 embedvar.h
  17. +7 −7 ext/B/B.xs
  18. +7 −6 ext/ByteLoader/byterun.c
  19. +2 −2 ext/Data/Dumper/Dumper.xs
  20. +14 −4 ext/Digest/MD5/MD5.xs
  21. +3 −3 ext/Digest/MD5/t/files.t
  22. +16 −3 ext/DynaLoader/DynaLoader_pm.PL
  23. +223 −0 ext/DynaLoader/dl_symbian.xs
  24. +8 −0 ext/DynaLoader/dlutils.c
  25. +24 −10 ext/Errno/Errno_pm.PL
  26. +1 −1  ext/IO/lib/IO/Socket.pm
  27. +21 −0 ext/List/Util/Util.xs
  28. +2 −2 ext/MIME/Base64/Base64.xs
  29. +22 −2 ext/POSIX/POSIX.xs
  30. +2 −2 ext/PerlIO/scalar/scalar.xs
  31. +2 −2 ext/PerlIO/via/via.xs
  32. +1 −1  ext/SDBM_File/sdbm/sdbm.c
  33. +98 −74 ext/Storable/Storable.xs
  34. +1 −0  ext/Time/HiRes/HiRes.xs
  35. +2 −0  global.sym
  36. +39 −35 globvar.sym
  37. +4 −0 gv.c
  38. +6 −0 hv.c
  39. +1 −1  intrpvar.h
  40. +17 −1 lib/ExtUtils/t/Embed.t
  41. +17 −4 lib/ExtUtils/xsubpp
  42. +1 −0  lib/File/Spec.pm
  43. +4 −2 lib/File/Spec/Win32.pm
  44. +3 −1 locale.c
  45. +34 −42 mg.c
  46. +20 −12 miniperlmain.c
  47. +1 −0  numeric.c
  48. +53 −4 op.c
  49. +34 −16 opcode.h
  50. +34 −16 opcode.pl
  51. +2 −0  pad.c
  52. +1 −1  patchlevel.h
  53. +78 −14 perl.c
  54. +146 −24 perl.h
  55. +32 −5 perlapi.c
  56. +49 −2 perlapi.h
  57. +69 −91 perlio.c
  58. +78 −64 perlio.h
  59. +61 −54 perliol.h
  60. +58 −5 perlvars.h
  61. +1 −0  pod.lst
  62. +1 −0  pod/perl.pod
  63. +27 −0 pod/perlguts.pod
  64. +10 −0 pod/perlintern.pod
  65. +8 −8 pp.c
  66. +38 −19 pp_ctl.c
  67. +9 −9 pp_hot.c
  68. +1 −1  pp_pack.c
  69. +4 −2 pp_sort.c
  70. +37 −28 pp_sys.c
  71. +8 −3 proto.h
  72. +1 −1  reentr.pl
  73. +5 −2 regcomp.c
  74. +4 −0 regexec.c
  75. +1 −0  scope.h
  76. +20 −20 sv.c
  77. +549 −0 symbian/PerlApp.cpp
  78. +60 −0 symbian/PerlApp.h
  79. +17 −0 symbian/PerlApp.hrh
  80. +141 −0 symbian/PerlApp.rss
  81. +21 −0 symbian/PerlAppAif.rss
  82. +409 −0 symbian/PerlBase.cpp
  83. +118 −0 symbian/PerlBase.h
  84. +202 −0 symbian/PerlBase.pod
  85. +57 −0 symbian/PerlRecog.cpp
  86. +9 −0 symbian/PerlRecog.mmp
  87. +20 −0 symbian/README
  88. +150 −0 symbian/TODO
  89. +4 −0 symbian/bld.inf
  90. +768 −0 symbian/config.pl
  91. +768 −0 symbian/config.sh
  92. +6 −0 symbian/cwd.pl
  93. +128 −0 symbian/demo_pl
  94. +108 −0 symbian/install.cfg
  95. +185 −0 symbian/makesis.pl
  96. +6 −0 symbian/port.pl
  97. +28 −0 symbian/sanity.pl
  98. +48 −0 symbian/sdk.pl
  99. +20 −0 symbian/symbian_dll.cpp
  100. +72 −0 symbian/symbian_proto.h
  101. +112 −0 symbian/symbian_stubs.c
  102. +22 −0 symbian/symbian_stubs.h
  103. +299 −0 symbian/symbian_utils.cpp
  104. +209 −0 symbian/symbianish.h
  105. +1 −0  symbian/uid.pl
  106. +22 −0 symbian/version.pl
  107. +861 −0 symbian/xsbuild.pl
  108. +2 −2 taint.c
  109. +26 −17 toke.c
  110. +3 −3 universal.c
  111. +5 −2 utf8.c
  112. +1 −1  utf8.h
  113. +122 −25 util.c
  114. +2 −2 util.h
  115. +10 −5 vms/descrip_mms.template
  116. +4 −3 win32/Makefile
  117. +4 −3 win32/makefile.mk
  118. +1 −1  win32/win32io.c
  119. +6 −6 xsutils.c
View
4 EXTERN.h
@@ -28,8 +28,8 @@
# define EXTCONST globalref
# define dEXTCONST globaldef {"$GLOBAL_RO_VARS"} readonly
#else
-# if defined(WIN32) && !defined(PERL_STATIC_SYMS)
-# ifdef PERLDLL
+# if (defined(WIN32) || defined(__SYMBIAN32__)) && !defined(PERL_STATIC_SYMS)
+# if defined(PERLDLL) || defined(__SYMBIAN32__)
# define EXT extern __declspec(dllexport)
# define dEXT
# define EXTCONST extern __declspec(dllexport) const
View
36 INTERN.h
@@ -28,24 +28,24 @@
# define EXTCONST globaldef {"$GLOBAL_RO_VARS"} readonly
# define dEXTCONST globaldef {"$GLOBAL_RO_VARS"} readonly
#else
-#if defined(WIN32) && defined(__MINGW32__)
-# define EXT __declspec(dllexport)
-# define dEXT
-# define EXTCONST __declspec(dllexport) const
-# define dEXTCONST const
-#else
-#ifdef __cplusplus
-# define EXT
-# define dEXT
-# define EXTCONST extern const
-# define dEXTCONST const
-#else
-# define EXT
-# define dEXT
-# define EXTCONST const
-# define dEXTCONST const
-#endif
-#endif
+# if (defined(WIN32) && defined(__MINGW32__)) || defined(__SYMBIAN32__)
+# define EXT __declspec(dllexport)
+# define dEXT
+# define EXTCONST __declspec(dllexport) const
+# define dEXTCONST const
+# else
+# ifdef __cplusplus
+# define EXT
+# define dEXT
+# define EXTCONST extern const
+# define dEXTCONST const
+# else
+# define EXT
+# define dEXT
+# define EXTCONST const
+# define dEXTCONST const
+# endif
+# endif
#endif
#undef INIT
View
33 MANIFEST
@@ -329,6 +329,7 @@ ext/DynaLoader/dl_mac.xs MacOS implementation
ext/DynaLoader/dl_mpeix.xs MPE/iX implementation
ext/DynaLoader/dl_next.xs NeXT implementation
ext/DynaLoader/dl_none.xs Stub implementation
+ext/DynaLoader/dl_symbian.xs Symbian implementation
ext/DynaLoader/dlutils.c Dynamic loader utilities for dl_*.xs files
ext/DynaLoader/dl_vmesa.xs VM/ESA implementation
ext/DynaLoader/dl_vms.xs VMS implementation
@@ -2445,6 +2446,7 @@ README.os400 Perl notes for OS/400
README.plan9 Perl notes for Plan 9
README.qnx Perl notes for QNX
README.solaris Perl notes for Solaris
+README.symbian Perl notes for Symbian
README.tru64 Perl notes for Tru64
README.tw Perl for Traditional Chinese (in Big5)
README.uts Perl notes for UTS
@@ -2470,6 +2472,37 @@ scope.c Scope entry and exit code
scope.h Scope entry and exit header
sv.c Scalar value code
sv.h Scalar value header
+symbian/bld.inf Symbian sample app build config
+symbian/config.pl Configuration script for Symbian
+symbian/config.sh Configuration data for Symbian
+symbian/cwd.pl Helper code for config.pl
+symbian/demo_pl "Archive" of demo code
+symbian/install.cfg Installation instructions
+symbian/makesis.pl Installation file creator
+symbian/PerlApp.cpp Symbian sample app code
+symbian/PerlApp.h Symbian sample app header
+symbian/PerlApp.hrh Symbian sample app resource header
+symbian/PerlApp.rss Symbian sample app resource definition
+symbian/PerlAppAif.rss Symbian sample app code
+symbian/PerlBase.cpp Symbian Perl base class
+symbian/PerlBase.h Symbian Perl base class header
+symbian/PerlBase.pod Symbian Perl base class documentation
+symbian/PerlRecog.cpp Symbian recognizer code
+symbian/PerlRecog.mmp Symbian recognizer build
+symbian/port.pl Helper code for config.pl
+symbian/README ReadMe for the Symbian files
+symbian/sanity.pl Helper code for config.pl
+symbian/sdk.pl Helper code for config.pl
+symbian/symbian_dll.cpp The DLL stub for Symbian
+symbian/symbianish.h Header for Symbian
+symbian/symbian_proto.h Prototypes for Symbian
+symbian/symbian_stubs.c Stub routines for Symbian
+symbian/symbian_stubs.h Stub headers for Symbian
+symbian/symbian_utils.cpp Helper routines for Symbian
+symbian/TODO Symbian things to do
+symbian/uid.pl Helper code for config.pl
+symbian/version.pl Helper code for config.pl
+symbian/xsbuild.pl Building extensions
taint.c Tainting code
t/base/cond.t See if conditionals work
t/base/if.t See if if works
View
7 Porting/curliff.pl
@@ -10,13 +10,20 @@
use vars qw($r);
+# This list is also in makerel.
my @FILES = qw(
djgpp/configure.bat
README.ce
README.dos
+ README.symbian
README.win32
+ symbian/config.pl
+ symbian/makesis.pl
+ symbian/README
+ symbian/xsbuild.pl
win32/Makefile
win32/makefile.mk
+ wince/Makefile.ce
wince/compile-all.bat
wince/README.perlce
wince/registry.bat
View
6 Porting/makerel
@@ -151,11 +151,17 @@ system("chmod +w @writables") == 0
or die "system: $!";
print "Adding CRs to DOSish files...\n";
+# This list is also in curliff.pl.
my @crlf = qw(
djgpp/configure.bat
README.ce
README.dos
+ README.symbian
README.win32
+ symbian/config.pl
+ symbian/makesis.pl
+ symbian/README
+ symbian/xsbuild.pl
win32/Makefile
win32/makefile.mk
wince/Makefile.ce
View
352 README.symbian
@@ -0,0 +1,352 @@
+If you read this file _as_is_, just ignore the funny characters you see.
+It is written in the POD format (see pod/perlpod.pod) which is specially
+designed to be readable as is.
+
+=head1 NAME
+
+README.symbian - Perl version 5 on Symbian OS
+
+=head1 DESCRIPTION
+
+This document describes various features of the Symbian operating
+system that will affect how Perl version 5 (hereafter just Perl)
+is compiled and/or runs.
+
+B<NOTE: this port (as of 0.1.0) does not compile into a Symbian
+OS GUI application, but instead it results in a Symbian DLL.>
+The DLL includes a C++ class called CPerlBase, which one can then
+(derive from and) use to embed Perl into applications, see F<symbian/README>.
+
+The base port of Perl to Symbian only implements the basic POSIX-like
+functionality; it does not implement any further Symbian or Series 60
+bindings for Perl.
+
+It is also possible to generate Symbian executables for "miniperl"
+and "perl", but since there is no standard command line interface
+for Symbian (nor full keyboards in the devices), these are useful
+mainly as demonstrations.
+
+=head2 Compiling Perl on Symbian
+
+(0) You need to have the Symbian SDK installed.
+
+ These instructions have been tested under various Nokia Series 60
+ Symbian SDKs (1.2 to 2.6). You can get the SDKs from
+ Forum Nokia (http://www.forum.nokia.com/).
+
+ A prerequisite for any of the SDKs is to install ActivePerl
+ from ActiveState, http://www.activestate.com/Products/ActivePerl/
+
+ Having the SDK installed also means that you need to have either
+ the Metrowerks CodeWarrior installed (2.8 and 3.0 were used in testing)
+ or the Microsoft Visual C++ 6.0 installed (SP3 minimum, SP5 recommended).
+
+ Note that for example the Serie s60 2.0 VC SDK installation talks
+ about ActivePerl build 518, which does no more (as of mid-2004) exist
+ at the ActiveState website. The ActivePerl 5.8.4 build 810 was
+ used successfully for compiling Perl on Symbian. The 5.6.x ActivePerls
+ do not work.
+
+ Other SDKs or compilers like Visual.NET, command-line-only
+ Visual.NET, Borland, GnuPoc, or sdk2unix have not been tried.
+
+ These instructions almost certainly won't work with older Symbian
+ releases or other SDKs. Patches to get this port running in other
+ releases, SDKs, compilers, platforms, or devices are naturally welcome.
+
+(1) Get a Perl source code distribution (for example the file
+ perl-5.9.2.tar.gz is fine) from http://www.cpan.org/src/
+ and unpack it in your the C:/Symbian directory of your Windows
+ system.
+
+(2) Change to the perl source directory.
+
+ cd c:\Symbian\perl-5.x.x
+
+(3) Run the following script using the perl coming with the SDK
+
+ perl symbian\config.pl
+
+ You must use the cmd.exe, the Cygwin shell will not work
+ (the PATH must include the SDK tools, including a Perl,
+ which should be the case under cmd.exe)
+
+(4) Build the project, either by
+
+ make all
+
+ in cmd.exe or by using either the Metrowerks CodeWarrior
+ or the Visual C++ 6.0.
+
+ If you use the VC IDE, you will have to run F<symbian\config.pl>
+ first using the cmd.exe, and then run 'make win.mf vc6.mf' to generate
+ the VC6 makefiles and workspaces.
+
+ The following Series 60 SDK and compiler configurations and Nokia
+ phones that were tested (+ = compiled and PerlApp run, - = not),
+ both for Perl 5.8.x and 5.9.x:
+
+ SDK | VC | CW |
+ ----+----+----+---
+ 1.2 | + | + | 3650 (*)
+ 2.0 | + | + | 6600
+ 2.1 | - | + | 6670
+ 2.6 | + | + | 6630
+
+ If you are using the 'make' directly, it is the GNU make from the SDKs,
+ and it will invoke the right make commands for the Windows emulator
+ build and the Arm target builds ('thumb' by default) as necessary.
+ (*) Compiles but does not work, unfortunately.
+
+ The build scripts assume the 'absolute style' SDK installs under C:,
+ the 'subst style' will not work.
+
+ If using the VC IDE, to build use for example the File->Open Workspace->
+ C:\Symbian\8.as\S60_2nd_FP2\epoc32\build\symbian\perl\perl\wins\perl.dsw
+ The emulator binaries will appear in the same directory.
+
+ If using the VC IDE, you will a lot of warnings in the beginning of
+ the build because a lot of headers mentioned by the source cannot
+ be found, but this is not serious since those headers are not used.
+
+ The Metrowerks will give a lot of warnings about unused variables and
+ empty declarations, you can ignore those.
+
+ When the Windows and Arm DLLs are built do not be scared by a very long
+ messages whizzing by: it is the "export freeze" phase where the whole
+ (rather large) API of Perl is listed.
+
+ Once the build is completed you need to create the DLL SIS file by
+
+ make perldll.sis
+
+ which will create the file perlXYZ.sis (the XYZ being the Perl version)
+ which you can then install into your Symbian device: an easy way
+ to do this is to send them via Bluetooth or infrared and just open
+ the messages.
+
+ Since the total size of all Perl SIS files once installed is
+ over 1.9 MB, it is recommended to do the installation into a
+ memory card (drive E:) instead of the C: drive.
+
+ The size of the perlXYZ.SIS is about 370 kB but once it is in the
+ device it is about one 750 kB (according to the application manager).
+
+ The perlXYZ.sis includes only the Perl DLL: to create an additional
+ SIS file which includes some of the standard (pure) Perl libraries,
+ issue the command
+
+ make perllib.sis
+
+ Some of the standard Perl libraries are included, but not all:
+ see L</HISTORY> or F<symbian\install.cfg> for more details
+ (250 kB -> 700 kB).
+
+ Some of the standard Perl XS extensions (see L</HISTORY> are
+ also available:
+
+ make perlext.sis
+
+ which will create perlXYZext.sis (210 kB -> 470 kB).
+
+ To compile the demonstration application PerlApp you need first to
+ install the Perl headers under the SDK.
+
+ To install the Perl headers and the class CPerlBase documentation
+ so that you no more need the Perl sources around to compile Perl
+ applications using the SDK:
+
+ make sdkinstall
+
+ The destination directory is C:\Symbian\perl\X.Y.Z. For more
+ details, see F<symbian\PerlBase.pod>.
+
+ Once the headers have been installed, you can create a SIS for
+ the PerlApp:
+
+ make perlapp.sis
+
+ The perlapp.sis (11 kB -> 16 kB) will be built in the symbian
+ subdirectory, but a copy will also be made to the main directory.
+
+ If you want to package the Perl DLLs (one for WINS, one for ARMI),
+ the headers, and the documentation:
+
+ make perlsdk.zip
+
+ which will create perlXYZsdk.zip that can be used in another
+ Windows system with the SDK, without having to compile Perl in
+ that system.
+
+ If you want to package the PerlApp sources:
+
+ make perlapp.zip
+
+ If you want to package the perl.exe and miniperl.exe, you
+ can use the perlexe.sis and miniperlexe.sis make targets.
+ You also probably want the perllib.sis for the libraries
+ and maybe even the perlapp.sis for the recognizer.
+
+ The make target 'allsis' combines all the above SIS targets.
+
+ To clean up after compilation you can use either of
+
+ make clean
+ make distclean
+
+ depending on how clean you want to be.
+
+=head2 Compilation problems
+
+If you see right after "make" this
+
+ cat makefile.sh >makefile
+ 'cat' is not recognized as an internal or external command,
+ operable program or batch file.
+
+it means you need to (re)run the symbian\config.pl.
+
+If you get the error
+
+ 'perl' is not recognized as an internal or external command,
+ operable program or batch file.
+
+you may need to reinstall the ActivePerl.
+
+If you see this
+
+ ren makedef.pl nomakedef.pl
+ The system cannot find the file specified.
+ C:\Symbian\...\make.exe: [rename_makedef] Error 1 (ignored)
+
+please ignore it since it is nothing serious (the build process of
+renames the Perl makedef.pl as nomakedef.pl to avoid confusing it
+with a makedef.pl of the SDK).
+
+=head2 PerlApp
+
+The PerlApp application demonstrates how to embed Perl interpreters
+to a Symbian application. The "Time" menu item runs the following
+Perl code: C<print "Running in ", $^O, "\n", scalar localtime>,
+the "Oneliner" allows one to type in Perl code, and the "Run"
+opens a file chooser for selecting a Perl file to run.
+
+The PerlApp also is started when the "Perl recognizer" (also included
+and installed) detects a Perl file being activated througg the GUI,
+and offers either to install it under \Perl (if the Perl file is in
+the inbox of the messaging application) or to run it (if the Perl file
+is under \Perl).
+
+=head2 Using Perl in Symbian
+
+First of all note that you have full access to the Symbian device
+when using Perl: you can do a lot of damage to your device (like
+removing system files) unless you are careful. Please do take
+backups before doing anything.
+
+The Perl port has been done for the most part using the Symbian
+standard POSIX-ish STDLIB library. It is a reasonably complete
+library, but certain corners of such emulation libraries that tend
+to be left unimplemented on non-UNIX platforms have been left
+unimplemented also this time: fork(), signals(), user/group ids,
+select() working for sockets, non-blocking sockets, and so forth.
+See the file symbian/config.sh and look for 'undef' to find the
+unsupported APIs (or from Perl use Config).
+
+The filesystem of Symbian devices uses DOSish syntax, "drives"
+separated from paths by a colon, and backslashes for the path.
+The exact assignment of the drives probably varies between platforms,
+but you might for example see C: as the flash main memory, D: as the
+RAM drive, E: as the memory card (MMC), Z: as the ROM. As far the
+devices go the NUL: is the bit bucket, the COMx: are the serial lines,
+IRCOMx: are the IR ports, TMP: might be C:\System\Temp. Remember to
+double those backslashes in doublequoted strings.
+
+The Perl DLL is installed in \System\Libs\. The Perl libraries and
+extension DLLs are installed in \System\Libs\Perl\X.Y.Z\. The PerlApp
+is installed in \System\Apps\, and the SIS also installs a couple of
+demo scripts in \Perl\.
+
+Note that the Symbian filesystem is very picky: it strongly prefers
+the \ instead of the /.
+
+When doing XS / Symbian C++ programming include first the Symbian
+headers, then any standard C/POSIX headers, then Perl headers, and finally
+any application headers.
+
+New() and Copy() are unfortunately used by both Symbian and Perl code
+so you'll have to play cpp games if you need them. PerlBase.h undefines
+the Perl definitions and redefines them as PerlNew() and PerlCopy().
+
+=head1 TO DO
+
+Lots. See F<symbian\TODO>.
+
+=head1 WARNING
+
+As of Perl Symbian port version 0.1.0 any part of Perl's standard
+regression test suite has not been run on a real Symbian device using
+the ported Perl, so innumerable bugs may lie in wait. Therefore there
+is absolutely no warranty.
+
+=head1 NOTE
+
+When creating and extending application programming interfaces (APIs)
+for Symbian or Series 60 it is suggested that trademarks, registered
+trademarks, or trade names are not used in the API names. Instead,
+developers should consider basing the API naming in the existing (C++)
+public component and API naming, modified as appropriate by the rules
+of the programming language the new APIs are for.
+
+Nokia is a registered trademark of Nokia Corporation. Nokia's product
+names are trademarks or registered trademarks of Nokia. Other product
+and company names mentioned herein may be trademarks or trade names of
+their respective owners.
+
+=head1 AUTHOR
+
+Jarkko Hietaniemi
+
+=head1 COPYRIGHT
+
+Copyright (c) 2004-2005 Nokia. All rights reserved.
+
+=head1 LICENSE
+
+The Symbian port is licensed under the same terms as Perl itself.
+
+=head1 HISTORY
+
+Perl Symbian Port version 0.1.0: April 2005
+(This will show as "0.01" in the Symbian Installer.)
+
+ - The console window is a very simple console indeed: one can
+ get the newline with "000" and the "C" button is a backspace.
+ Do not expect a terminal capable of vt100 or ANSI sequences.
+ The console is also "ASCII", you cannot input e.g. any accented
+ letters. Because of obvious physical constraints the console is
+ also very small: (in Nokia 6600) 22 columns, 17 rows.
+ - The following libraries are available:
+ AnyDBM_File AutoLoader base Carp Config Cwd constant
+ DynaLoader Exporter File::Spec integer lib strict Symbol
+ vars warnings XSLoader
+ - The following extensions are available:
+ attrs Cwd Data::Dumper Devel::Peek Digest::MD5 DynaLoader
+ Fcntl File::Glob Filter::Util::Call IO List::Util MIME::Base64
+ PerlIO::scalar PerlIO::via SDBM_File Socket Storable Time::HiRes
+ - The following extensions are missing for various technical reasons:
+ B ByteLoader Devel::DProf Devel::PPPort Encode GDBM_File
+ I18N::Langinfo IPC::SysV NDBM_File Opcode PerlIO::encoding POSIX
+ re Safe Sys::Hostname Sys::Syslog
+ threads threads::shared Unicode::Normalize
+ - Using MakeMaker or the Module::* to build and install modules
+ is not supported. A future solution might use the native
+ SIS packaging format (see symbian\TODO).
+ - Building XS other than the ones in the core is not supported.
+
+Since this is 0.1.0, any future releases are almost guaranteed to be
+binary incompatible. As a sign of this the Symbian symbol exports are
+kept unfrozen and the .def files rebuilt every time.
+
+=cut
+
View
7 XSUB.h
@@ -80,9 +80,14 @@ is a lexical $_ in scope.
#define ST(off) PL_stack_base[ax + (off)]
+#undef XS
#if defined(__CYGWIN__) && defined(USE_DYNAMIC_LOADING)
# define XS(name) __declspec(dllexport) void name(pTHX_ CV* cv)
-#else
+#endif
+#if defined(SYMBIAN)
+# define XS(name) EXPORT_C void name(pTHX_ CV* cv)
+#endif
+#ifndef XS
# define XS(name) void name(pTHX_ CV* cv)
#endif
View
5 av.c
@@ -525,6 +525,7 @@ to accommodate the addition.
void
Perl_av_push(pTHX_ register AV *av, SV *val)
{
+ dVAR;
MAGIC *mg;
if (!av)
return;
@@ -560,6 +561,7 @@ is empty.
SV *
Perl_av_pop(pTHX_ register AV *av)
{
+ dVAR;
SV *retval;
MAGIC* mg;
@@ -605,6 +607,7 @@ must then use C<av_store> to assign values to these new elements.
void
Perl_av_unshift(pTHX_ register AV *av, register I32 num)
{
+ dVAR;
register I32 i;
register SV **ary;
MAGIC* mg;
@@ -676,6 +679,7 @@ Shifts an SV off the beginning of the array.
SV *
Perl_av_shift(pTHX_ register AV *av)
{
+ dVAR;
SV *retval;
MAGIC* mg;
@@ -738,6 +742,7 @@ Perl's C<$#array = $fill;>.
void
Perl_av_fill(pTHX_ register AV *av, I32 fill)
{
+ dVAR;
MAGIC *mg;
if (!av)
Perl_croak(aTHX_ "panic: null array");
View
1  bytecode.pl
@@ -105,6 +105,7 @@ package B::Asmdata;
int
byterun(pTHX_ register struct byteloader_state *bstate)
{
+ dVAR;
register int insn;
U32 ix;
SV *specialsv_list[6];
View
9 configpm
@@ -424,12 +424,16 @@ EOT
foreach my $prefix (qw(ccflags ldflags)) {
my $value = fetch_string ({}, $prefix);
my $withlargefiles = fetch_string ({}, $prefix . "_uselargefiles");
- $value =~ s/\Q$withlargefiles\E\b//;
- print CONFIG_HEAVY "${prefix}_nolargefiles='$value'\n";
+ if (defined $withlargefiles) {
+ $value =~ s/\Q$withlargefiles\E\b//;
+ print CONFIG_HEAVY "${prefix}_nolargefiles='$value'\n";
+ }
}
foreach my $prefix (qw(libs libswanted)) {
my $value = fetch_string ({}, $prefix);
+ my $withlf = fetch_string ({}, 'libswanted_uselargefiles');
+ next unless defined $withlf;
my @lflibswanted
= split(' ', fetch_string ({}, 'libswanted_uselargefiles'));
if (@lflibswanted) {
@@ -861,6 +865,7 @@ EOS
# Now do some simple tests on the Config.pm file we have created
unshift(@INC,'lib');
+unshift(@INC,'xlib/symbian') if $Opts{cross};
require $Config_PM;
import Config;
View
20 doio.c
@@ -81,6 +81,7 @@ Perl_do_openn(pTHX_ GV *gv, register char *name, I32 len, int as_raw,
int rawmode, int rawperm, PerlIO *supplied_fp, SV **svp,
I32 num_svs)
{
+ dVAR;
register IO *io = GvIOn(gv);
PerlIO *saveifp = Nullfp;
PerlIO *saveofp = Nullfp;
@@ -1241,9 +1242,8 @@ Perl_do_binmode(pTHX_ PerlIO *fp, int iotype, int mode)
}
#if !defined(HAS_TRUNCATE) && !defined(HAS_CHSIZE)
-I32 my_chsize(fd, length)
-I32 fd; /* file descriptor */
-Off_t length; /* length to set file to */
+I32
+my_chsize(int fd, Off_t length)
{
#ifdef F_FREESP
/* code courtesy of William Kucharski */
@@ -1287,12 +1287,11 @@ Off_t length; /* length to set file to */
return -1;
}
-
return 0;
#else
- dTHX;
- DIE(aTHX_ "truncate not implemented");
+ Perl_croak_nocontext("truncate not implemented");
#endif /* F_FREESP */
+ return -1;
}
#endif /* !HAS_TRUNCATE && !HAS_CHSIZE */
@@ -1418,7 +1417,7 @@ Perl_my_stat(pTHX)
}
}
-static char no_prev_lstat[] = "The stat preceding -l _ wasn't an lstat";
+static const char no_prev_lstat[] = "The stat preceding -l _ wasn't an lstat";
I32
Perl_my_lstat(pTHX)
@@ -1471,7 +1470,8 @@ bool
Perl_do_aexec5(pTHX_ SV *really, register SV **mark, register SV **sp,
int fd, int do_report)
{
-#ifdef MACOS_TRADITIONAL
+ dVAR;
+#if defined(MACOS_TRADITIONAL) || defined(SYMBIAN)
Perl_croak(aTHX_ "exec? I'm not *that* kind of operating system");
#else
register char **a;
@@ -1527,7 +1527,7 @@ Perl_do_execfree(pTHX)
}
}
-#if !defined(OS2) && !defined(WIN32) && !defined(DJGPP) && !defined(EPOC) && !defined(MACOS_TRADITIONAL)
+#if !defined(OS2) && !defined(WIN32) && !defined(DJGPP) && !defined(EPOC) && !defined(SYMBIAN) && !defined(MACOS_TRADITIONAL)
bool
Perl_do_exec(pTHX_ char *cmd)
@@ -1538,6 +1538,7 @@ Perl_do_exec(pTHX_ char *cmd)
bool
Perl_do_exec3(pTHX_ char *cmd, int fd, int do_report)
{
+ dVAR;
register char **a;
register char *s;
@@ -2306,6 +2307,7 @@ Moving it away shrinks pp_hot.c; shrinking pp_hot.c helps speed perl up.
PerlIO *
Perl_start_glob (pTHX_ SV *tmpglob, IO *io)
{
+ dVAR;
SV *tmpcmd = NEWSV(55, 0);
PerlIO *fp;
ENTER;
View
26 dump.c
@@ -25,7 +25,7 @@
#include "perl.h"
#include "regcomp.h"
-static HV *Sequence;
+#define Sequence PL_op_sequence
void
Perl_dump_indent(pTHX_ I32 level, PerlIO *file, const char* pat, ...)
@@ -153,6 +153,7 @@ Perl_pv_display(pTHX_ SV *dsv, const char *pv, STRLEN cur, STRLEN len, STRLEN pv
char *
Perl_sv_peek(pTHX_ SV *sv)
{
+ dVAR;
SV *t = sv_newmortal();
STRLEN n_a;
int unref = 0;
@@ -404,16 +405,13 @@ Perl_pmop_dump(pTHX_ PMOP *pm)
STATIC void
sequence(pTHX_ register const OP *o)
{
+ dVAR;
SV *op;
char *key;
STRLEN len;
- static UV seq;
const OP *oldop = 0;
OP *l;
- if (!Sequence)
- Sequence = newHV();
-
if (!o)
return;
@@ -431,7 +429,7 @@ sequence(pTHX_ register const OP *o)
switch (o->op_type) {
case OP_STUB:
if ((o->op_flags & OPf_WANT) != OPf_WANT_LIST) {
- hv_store(Sequence, key, len, newSVuv(++seq), 0);
+ hv_store(Sequence, key, len, newSVuv(++PL_op_seq), 0);
break;
}
goto nothin;
@@ -445,7 +443,7 @@ sequence(pTHX_ register const OP *o)
nothin:
if (oldop && o->op_next)
continue;
- hv_store(Sequence, key, len, newSVuv(++seq), 0);
+ hv_store(Sequence, key, len, newSVuv(++PL_op_seq), 0);
break;
case OP_MAPWHILE:
@@ -458,7 +456,7 @@ sequence(pTHX_ register const OP *o)
case OP_DORASSIGN:
case OP_COND_EXPR:
case OP_RANGE:
- hv_store(Sequence, key, len, newSVuv(++seq), 0);
+ hv_store(Sequence, key, len, newSVuv(++PL_op_seq), 0);
for (l = cLOGOPo->op_other; l && l->op_type == OP_NULL; l = l->op_next)
;
sequence(aTHX_ l);
@@ -466,7 +464,7 @@ sequence(pTHX_ register const OP *o)
case OP_ENTERLOOP:
case OP_ENTERITER:
- hv_store(Sequence, key, len, newSVuv(++seq), 0);
+ hv_store(Sequence, key, len, newSVuv(++PL_op_seq), 0);
for (l = cLOOPo->op_redoop; l && l->op_type == OP_NULL; l = l->op_next)
;
sequence(aTHX_ l);
@@ -481,7 +479,7 @@ sequence(pTHX_ register const OP *o)
case OP_QR:
case OP_MATCH:
case OP_SUBST:
- hv_store(Sequence, key, len, newSVuv(++seq), 0);
+ hv_store(Sequence, key, len, newSVuv(++PL_op_seq), 0);
for (l = cPMOPo->op_pmreplstart; l && l->op_type == OP_NULL; l = l->op_next)
;
sequence(aTHX_ l);
@@ -491,7 +489,7 @@ sequence(pTHX_ register const OP *o)
break;
default:
- hv_store(Sequence, key, len, newSVuv(++seq), 0);
+ hv_store(Sequence, key, len, newSVuv(++PL_op_seq), 0);
break;
}
oldop = o;
@@ -501,6 +499,7 @@ sequence(pTHX_ register const OP *o)
STATIC UV
sequence_num(pTHX_ const OP *o)
{
+ dVAR;
SV *op,
**seq;
char *key;
@@ -515,6 +514,7 @@ sequence_num(pTHX_ const OP *o)
void
Perl_do_op_dump(pTHX_ I32 level, PerlIO *file, const OP *o)
{
+ dVAR;
UV seq;
sequence(aTHX_ o);
Perl_dump_indent(aTHX_ level, file, "{\n");
@@ -887,7 +887,7 @@ Perl_gv_dump(pTHX_ GV *gv)
* (with the PERL_MAGIC_ prefixed stripped)
*/
-static struct { const char type; const char *name; } magic_names[] = {
+static const struct { const char type; const char *name; } magic_names[] = {
{ PERL_MAGIC_sv, "sv(\\0)" },
{ PERL_MAGIC_arylen, "arylen(#)" },
{ PERL_MAGIC_glob, "glob(*)" },
@@ -982,7 +982,7 @@ Perl_do_magic_dump(pTHX_ I32 level, PerlIO *file, const MAGIC *mg, I32 nest, I32
{
int n;
const char *name = 0;
- for (n=0; magic_names[n].name; n++) {
+ for (n = 0; magic_names[n].name; n++) {
if (mg->mg_type == magic_names[n].type) {
name = magic_names[n].name;
break;
View
11 embed.fnc
@@ -170,7 +170,7 @@ p |void |do_chop |SV* asv|SV* sv
Ap |bool |do_close |GV* gv|bool not_implicit
p |bool |do_eof |GV* gv
p |bool |do_exec |char* cmd
-#if defined(WIN32)
+#if defined(WIN32) || defined(SYMBIAN)
Ap |int |do_aspawn |SV* really|SV** mark|SV** sp
Ap |int |do_spawn |char* cmd
Ap |int |do_spawn_nowait|char* cmd
@@ -245,7 +245,7 @@ Ap |GV* |gv_autoload4 |HV* stash|const char* name|STRLEN len \
|I32 method
Ap |void |gv_check |HV* stash
Ap |void |gv_efullname |SV* sv|const GV* gv
-Amb |void |gv_efullname3 |SV* sv|const GV* gv|const char* prefix
+Apmb |void |gv_efullname3 |SV* sv|const GV* gv|const char* prefix
Ap |void |gv_efullname4 |SV* sv|const GV* gv|const char* prefix|bool keepmain
Ap |GV* |gv_fetchfile |const char* name
Apd |GV* |gv_fetchmeth |HV* stash|const char* name|STRLEN len \
@@ -257,7 +257,7 @@ Apd |GV* |gv_fetchmethod_autoload|HV* stash|const char* name \
|I32 autoload
Ap |GV* |gv_fetchpv |const char* name|I32 add|I32 sv_type
Ap |void |gv_fullname |SV* sv|const GV* gv
-Amb |void |gv_fullname3 |SV* sv|const GV* gv|const char* prefix
+Apmb |void |gv_fullname3 |SV* sv|const GV* gv|const char* prefix
Ap |void |gv_fullname4 |SV* sv|const GV* gv|const char* prefix|bool keepmain
Ap |void |gv_init |GV* gv|HV* stash|const char* name \
|STRLEN len|int multi
@@ -1290,8 +1290,10 @@ s |SV*|isa_lookup |HV *stash|const char *name|HV *name_stash|int len|int level
#endif
#if defined(PERL_IN_LOCALE_C) || defined(PERL_DECL_PROT)
+#if defined(USE_LOCALE_NUMERIC) || defined(USE_LOCALE_COLLATE)
s |char* |stdize_locale |char* locs
#endif
+#endif
#if defined(PERL_IN_UTIL_C) || defined(PERL_DECL_PROT)
s |COP* |closest_cop |COP *cop|OP *o
@@ -1480,4 +1482,7 @@ dp |bool |is_gv_magical_sv|SV *name|U32 flags
Apd |char* |savesvpv |SV* sv
+Ap |struct perl_vars*|init_global_struct
+Ap |void |free_global_struct|struct perl_vars*
+
END_EXTERN_C
View
12 embed.h
@@ -188,7 +188,7 @@
#ifdef PERL_CORE
#define do_exec Perl_do_exec
#endif
-#if defined(WIN32)
+#if defined(WIN32) || defined(SYMBIAN)
#define do_aspawn Perl_do_aspawn
#define do_spawn Perl_do_spawn
#define do_spawn_nowait Perl_do_spawn_nowait
@@ -1995,10 +1995,12 @@
#endif
#endif
#if defined(PERL_IN_LOCALE_C) || defined(PERL_DECL_PROT)
+#if defined(USE_LOCALE_NUMERIC) || defined(USE_LOCALE_COLLATE)
#ifdef PERL_CORE
#define stdize_locale S_stdize_locale
#endif
#endif
+#endif
#if defined(PERL_IN_UTIL_C) || defined(PERL_DECL_PROT)
#ifdef PERL_CORE
#define closest_cop S_closest_cop
@@ -2265,6 +2267,8 @@
#define is_gv_magical_sv Perl_is_gv_magical_sv
#endif
#define savesvpv Perl_savesvpv
+#define init_global_struct Perl_init_global_struct
+#define free_global_struct Perl_free_global_struct
#define ck_anoncode Perl_ck_anoncode
#define ck_bitop Perl_ck_bitop
#define ck_concat Perl_ck_concat
@@ -2800,7 +2804,7 @@
#ifdef PERL_CORE
#define do_exec(a) Perl_do_exec(aTHX_ a)
#endif
-#if defined(WIN32)
+#if defined(WIN32) || defined(SYMBIAN)
#define do_aspawn(a,b,c) Perl_do_aspawn(aTHX_ a,b,c)
#define do_spawn(a) Perl_do_spawn(aTHX_ a)
#define do_spawn_nowait(a) Perl_do_spawn_nowait(aTHX_ a)
@@ -4598,10 +4602,12 @@
#endif
#endif
#if defined(PERL_IN_LOCALE_C) || defined(PERL_DECL_PROT)
+#if defined(USE_LOCALE_NUMERIC) || defined(USE_LOCALE_COLLATE)
#ifdef PERL_CORE
#define stdize_locale(a) S_stdize_locale(aTHX_ a)
#endif
#endif
+#endif
#if defined(PERL_IN_UTIL_C) || defined(PERL_DECL_PROT)
#ifdef PERL_CORE
#define closest_cop(a,b) S_closest_cop(aTHX_ a,b)
@@ -4868,6 +4874,8 @@
#define is_gv_magical_sv(a,b) Perl_is_gv_magical_sv(aTHX_ a,b)
#endif
#define savesvpv(a) Perl_savesvpv(aTHX_ a)
+#define init_global_struct() Perl_init_global_struct(aTHX)
+#define free_global_struct(a) Perl_free_global_struct(aTHX_ a)
#define ck_anoncode(a) Perl_ck_anoncode(aTHX_ a)
#define ck_bitop(a) Perl_ck_bitop(aTHX_ a)
#define ck_concat(a) Perl_ck_concat(aTHX_ a)
View
61 embed.pl
@@ -274,7 +274,7 @@ (\%$$@)
or die "embed.pl: Can't open $file: $!\n";
while (<FILE>) {
s/[ \t]*#.*//; # Delete comments.
- if (/PERLVARA?I?C?\($pre(\w+)/) {
+ if (/PERLVARA?I?S?C?\($pre(\w+)/) {
my $sym = $1;
$sym = $pre . $sym if $keep_pre;
warn "duplicate symbol $sym while processing $file\n"
@@ -609,7 +609,8 @@ END
END
for $sym (sort keys %globvar) {
- print EM multon($sym,'G','PL_Vars.');
+ print EM multon($sym, 'G','my_vars->');
+ print EM multon("G$sym",'', 'my_vars->');
}
print EM <<'END';
@@ -662,11 +663,14 @@ END
#undef PERLVARA
#undef PERLVARI
#undef PERLVARIC
+#undef PERLVARISC
#define PERLVAR(v,t) EXTERN_C t* Perl_##v##_ptr(pTHX);
#define PERLVARA(v,n,t) typedef t PL_##v##_t[n]; \
EXTERN_C PL_##v##_t* Perl_##v##_ptr(pTHX);
#define PERLVARI(v,t,i) PERLVAR(v,t)
#define PERLVARIC(v,t,i) PERLVAR(v, const t)
+#define PERLVARISC(v,i) typedef const char PL_##v##_t[sizeof(i)]; \
+ EXTERN_C PL_##v##_t* Perl_##v##_ptr(pTHX);
#include "thrdvar.h"
#include "intrpvar.h"
@@ -676,6 +680,16 @@ END
#undef PERLVARA
#undef PERLVARI
#undef PERLVARIC
+#undef PERLVARISC
+
+#ifndef PERL_GLOBAL_STRUCT
+EXTERN_C Perl_ppaddr_t** Perl_Gppaddr_ptr(pTHX);
+EXTERN_C Perl_check_t** Perl_Gcheck_ptr(pTHX);
+EXTERN_C unsigned char** Perl_Gfold_locale_ptr(pTHX);
+#define Perl_ppaddr_ptr Perl_Gppaddr_ptr
+#define Perl_check_ptr Perl_Gcheck_ptr
+#define Perl_fold_locale_ptr Perl_Gfold_locale_ptr
+#endif
END_EXTERN_C
@@ -691,9 +705,9 @@ END
START_EXTERN_C
#ifndef DOINIT
-EXT void *PL_force_link_funcs[];
+EXTCONST void * const PL_force_link_funcs[];
#else
-EXT void *PL_force_link_funcs[] = {
+EXTCONST void * const PL_force_link_funcs[] = {
#undef PERLVAR
#undef PERLVARA
#undef PERLVARI
@@ -702,6 +716,7 @@ END
#define PERLVARA(v,n,t) PERLVAR(v,t)
#define PERLVARI(v,t,i) PERLVAR(v,t)
#define PERLVARIC(v,t,i) PERLVAR(v,t)
+#define PERLVARISC(v,i) PERLVAR(v,char)
#include "thrdvar.h"
#include "intrpvar.h"
@@ -711,6 +726,7 @@ END
#undef PERLVARA
#undef PERLVARI
#undef PERLVARIC
+#undef PERLVARISC
};
#endif /* DOINIT */
@@ -759,14 +775,17 @@ END
#undef PERLVARA
#undef PERLVARI
#undef PERLVARIC
+#undef PERLVARISC
#define PERLVAR(v,t) t* Perl_##v##_ptr(pTHX) \
- { return &(aTHX->v); }
+ { dVAR; return &(aTHX->v); }
#define PERLVARA(v,n,t) PL_##v##_t* Perl_##v##_ptr(pTHX) \
- { return &(aTHX->v); }
+ { dVAR; return &(aTHX->v); }
#define PERLVARI(v,t,i) PERLVAR(v,t)
#define PERLVARIC(v,t,i) PERLVAR(v, const t)
+#define PERLVARISC(v,i) PL_##v##_t* Perl_##v##_ptr(pTHX) \
+ { dVAR; return &(aTHX->v); }
#include "thrdvar.h"
#include "intrpvar.h"
@@ -774,18 +793,42 @@ END
#undef PERLVAR
#undef PERLVARA
#define PERLVAR(v,t) t* Perl_##v##_ptr(pTHX) \
- { return &(PL_##v); }
+ { dVAR; return &(PL_##v); }
#define PERLVARA(v,n,t) PL_##v##_t* Perl_##v##_ptr(pTHX) \
- { return &(PL_##v); }
+ { dVAR; return &(PL_##v); }
#undef PERLVARIC
-#define PERLVARIC(v,t,i) const t* Perl_##v##_ptr(pTHX) \
+#undef PERLVARISC
+#define PERLVARIC(v,t,i) \
+ const t* Perl_##v##_ptr(pTHX) \
{ return (const t *)&(PL_##v); }
+#define PERLVARISC(v,i) PL_##v##_t* Perl_##v##_ptr(pTHX) \
+ { dVAR; return &(PL_##v); }
#include "perlvars.h"
#undef PERLVAR
#undef PERLVARA
#undef PERLVARI
#undef PERLVARIC
+#undef PERLVARISC
+
+#ifndef PERL_GLOBAL_STRUCT
+/* A few evil special cases. Could probably macrofy this. */
+#undef PL_ppaddr
+#undef PL_check
+#undef PL_fold_locale
+Perl_ppaddr_t** Perl_Gppaddr_ptr(pTHX) {
+ static const Perl_ppaddr_t* ppaddr_ptr = PL_ppaddr;
+ return (Perl_ppaddr_t**)&ppaddr_ptr;
+}
+Perl_check_t** Perl_Gcheck_ptr(pTHX) {
+ static const Perl_check_t* check_ptr = PL_check;
+ return (Perl_check_t**)&check_ptr;
+}
+unsigned char** Perl_Gfold_locale_ptr(pTHX) {
+ static const unsigned char* fold_locale_ptr = PL_fold_locale;
+ return (unsigned char**)&fold_locale_ptr;
+}
+#endif
END_EXTERN_C
View
93 embedvar.h
@@ -885,39 +885,102 @@
#if defined(PERL_GLOBAL_STRUCT)
-#define PL_No (PL_Vars.GNo)
-#define PL_Yes (PL_Vars.GYes)
-#define PL_csighandlerp (PL_Vars.Gcsighandlerp)
-#define PL_curinterp (PL_Vars.Gcurinterp)
-#define PL_do_undump (PL_Vars.Gdo_undump)
-#define PL_dollarzero_mutex (PL_Vars.Gdollarzero_mutex)
-#define PL_hexdigit (PL_Vars.Ghexdigit)
-#define PL_malloc_mutex (PL_Vars.Gmalloc_mutex)
-#define PL_op_mutex (PL_Vars.Gop_mutex)
-#define PL_patleave (PL_Vars.Gpatleave)
-#define PL_sh_path (PL_Vars.Gsh_path)
-#define PL_sigfpe_saved (PL_Vars.Gsigfpe_saved)
-#define PL_sv_placeholder (PL_Vars.Gsv_placeholder)
-#define PL_thr_key (PL_Vars.Gthr_key)
-#define PL_use_safe_putenv (PL_Vars.Guse_safe_putenv)
+#define PL_No (my_vars->GNo)
+#define PL_GNo (my_vars->GNo)
+#define PL_Yes (my_vars->GYes)
+#define PL_GYes (my_vars->GYes)
+#define PL_appctx (my_vars->Gappctx)
+#define PL_Gappctx (my_vars->Gappctx)
+#define PL_check (my_vars->Gcheck)
+#define PL_Gcheck (my_vars->Gcheck)
+#define PL_csighandlerp (my_vars->Gcsighandlerp)
+#define PL_Gcsighandlerp (my_vars->Gcsighandlerp)
+#define PL_curinterp (my_vars->Gcurinterp)
+#define PL_Gcurinterp (my_vars->Gcurinterp)
+#define PL_do_undump (my_vars->Gdo_undump)
+#define PL_Gdo_undump (my_vars->Gdo_undump)
+#define PL_dollarzero_mutex (my_vars->Gdollarzero_mutex)
+#define PL_Gdollarzero_mutex (my_vars->Gdollarzero_mutex)
+#define PL_fold_locale (my_vars->Gfold_locale)
+#define PL_Gfold_locale (my_vars->Gfold_locale)
+#define PL_hexdigit (my_vars->Ghexdigit)
+#define PL_Ghexdigit (my_vars->Ghexdigit)
+#define PL_malloc_mutex (my_vars->Gmalloc_mutex)
+#define PL_Gmalloc_mutex (my_vars->Gmalloc_mutex)
+#define PL_mmap_page_size (my_vars->Gmmap_page_size)
+#define PL_Gmmap_page_size (my_vars->Gmmap_page_size)
+#define PL_op_mutex (my_vars->Gop_mutex)
+#define PL_Gop_mutex (my_vars->Gop_mutex)
+#define PL_op_seq (my_vars->Gop_seq)
+#define PL_Gop_seq (my_vars->Gop_seq)
+#define PL_op_sequence (my_vars->Gop_sequence)
+#define PL_Gop_sequence (my_vars->Gop_sequence)
+#define PL_patleave (my_vars->Gpatleave)
+#define PL_Gpatleave (my_vars->Gpatleave)
+#define PL_perlio_debug_fd (my_vars->Gperlio_debug_fd)
+#define PL_Gperlio_debug_fd (my_vars->Gperlio_debug_fd)
+#define PL_perlio_fd_refcnt (my_vars->Gperlio_fd_refcnt)
+#define PL_Gperlio_fd_refcnt (my_vars->Gperlio_fd_refcnt)
+#define PL_ppaddr (my_vars->Gppaddr)
+#define PL_Gppaddr (my_vars->Gppaddr)
+#define PL_sh_path (my_vars->Gsh_path)
+#define PL_Gsh_path (my_vars->Gsh_path)
+#define PL_sig_defaulting (my_vars->Gsig_defaulting)
+#define PL_Gsig_defaulting (my_vars->Gsig_defaulting)
+#define PL_sig_handlers_initted (my_vars->Gsig_handlers_initted)
+#define PL_Gsig_handlers_initted (my_vars->Gsig_handlers_initted)
+#define PL_sig_ignoring (my_vars->Gsig_ignoring)
+#define PL_Gsig_ignoring (my_vars->Gsig_ignoring)
+#define PL_sig_sv (my_vars->Gsig_sv)
+#define PL_Gsig_sv (my_vars->Gsig_sv)
+#define PL_sig_trapped (my_vars->Gsig_trapped)
+#define PL_Gsig_trapped (my_vars->Gsig_trapped)
+#define PL_sigfpe_saved (my_vars->Gsigfpe_saved)
+#define PL_Gsigfpe_saved (my_vars->Gsigfpe_saved)
+#define PL_sv_placeholder (my_vars->Gsv_placeholder)
+#define PL_Gsv_placeholder (my_vars->Gsv_placeholder)
+#define PL_thr_key (my_vars->Gthr_key)
+#define PL_Gthr_key (my_vars->Gthr_key)
+#define PL_timesbase (my_vars->Gtimesbase)
+#define PL_Gtimesbase (my_vars->Gtimesbase)
+#define PL_use_safe_putenv (my_vars->Guse_safe_putenv)
+#define PL_Guse_safe_putenv (my_vars->Guse_safe_putenv)
+#define PL_watch_pvx (my_vars->Gwatch_pvx)
+#define PL_Gwatch_pvx (my_vars->Gwatch_pvx)
#else /* !PERL_GLOBAL_STRUCT */
#define PL_GNo PL_No
#define PL_GYes PL_Yes
+#define PL_Gappctx PL_appctx
+#define PL_Gcheck PL_check
#define PL_Gcsighandlerp PL_csighandlerp
#define PL_Gcurinterp PL_curinterp
#define PL_Gdo_undump PL_do_undump
#define PL_Gdollarzero_mutex PL_dollarzero_mutex
+#define PL_Gfold_locale PL_fold_locale
#define PL_Ghexdigit PL_hexdigit
#define PL_Gmalloc_mutex PL_malloc_mutex
+#define PL_Gmmap_page_size PL_mmap_page_size
#define PL_Gop_mutex PL_op_mutex
+#define PL_Gop_seq PL_op_seq
+#define PL_Gop_sequence PL_op_sequence
#define PL_Gpatleave PL_patleave
+#define PL_Gperlio_debug_fd PL_perlio_debug_fd
+#define PL_Gperlio_fd_refcnt PL_perlio_fd_refcnt
+#define PL_Gppaddr PL_ppaddr
#define PL_Gsh_path PL_sh_path
+#define PL_Gsig_defaulting PL_sig_defaulting
+#define PL_Gsig_handlers_initted PL_sig_handlers_initted
+#define PL_Gsig_ignoring PL_sig_ignoring
+#define PL_Gsig_sv PL_sig_sv
+#define PL_Gsig_trapped PL_sig_trapped
#define PL_Gsigfpe_saved PL_sigfpe_saved
#define PL_Gsv_placeholder PL_sv_placeholder
#define PL_Gthr_key PL_thr_key
+#define PL_Gtimesbase PL_timesbase
#define PL_Guse_safe_putenv PL_use_safe_putenv
+#define PL_Gwatch_pvx PL_watch_pvx
#endif /* PERL_GLOBAL_STRUCT */
View
14 ext/B/B.xs
@@ -19,7 +19,7 @@ typedef FILE * InputStream;
#endif
-static char *svclassnames[] = {
+static const char* const svclassnames[] = {
"B::NULL",
"B::IV",
"B::NV",
@@ -58,7 +58,7 @@ typedef enum {
OPc_COP /* 11 */
} opclass;
-static char *opclassnames[] = {
+static const char* const opclassnames[] = {
"B::NULL",
"B::OP",
"B::UNOP",
@@ -73,7 +73,7 @@ static char *opclassnames[] = {
"B::COP"
};
-static size_t opsizes[] = {
+static const size_t opsizes[] = {
0,
sizeof(OP),
sizeof(UNOP),
@@ -211,13 +211,13 @@ cc_opclass(pTHX_ OP *o)
static char *
cc_opclassname(pTHX_ OP *o)
{
- return opclassnames[cc_opclass(aTHX_ o)];
+ return (char *)opclassnames[cc_opclass(aTHX_ o)];
}
static SV *
make_sv_object(pTHX_ SV *arg, SV *sv)
{
- char *type = 0;
+ const char *type = 0;
IV iv;
dMY_CXT;
@@ -734,7 +734,7 @@ threadsv_names()
#define OP_next(o) o->op_next
#define OP_sibling(o) o->op_sibling
-#define OP_desc(o) PL_op_desc[o->op_type]
+#define OP_desc(o) (char *)PL_op_desc[o->op_type]
#define OP_targ(o) o->op_targ
#define OP_type(o) o->op_type
#if PERL_VERSION >= 9
@@ -769,7 +769,7 @@ char *
OP_name(o)
B::OP o
CODE:
- RETVAL = PL_op_name[o->op_type];
+ RETVAL = (char *)PL_op_name[o->op_type];
OUTPUT:
RETVAL
View
13 ext/ByteLoader/byterun.c
@@ -47,6 +47,7 @@ bset_obj_store(pTHX_ struct byteloader_state *bstate, void *obj, I32 ix)
int
byterun(pTHX_ register struct byteloader_state *bstate)
{
+ dVAR;
register int insn;
U32 ix;
SV *specialsv_list[6];
@@ -216,7 +217,7 @@ byterun(pTHX_ register struct byteloader_state *bstate)
{
svindex arg;
BGET_svindex(arg);
- SvRV(bstate->bs_sv) = arg;
+ BSET_xrv(bstate->bs_sv, arg);
break;
}
case INSN_XPV: /* 22 */
@@ -228,28 +229,28 @@ byterun(pTHX_ register struct byteloader_state *bstate)
{
STRLEN arg;
BGET_PADOFFSET(arg);
- SvCUR(bstate->bs_sv) = arg;
+ BSET_xpv_cur(bstate->bs_sv, arg);
break;
}
case INSN_XPV_LEN: /* 24 */
{
STRLEN arg;
BGET_PADOFFSET(arg);
- SvLEN(bstate->bs_sv) = arg;
+ BSET_xpv_len(bstate->bs_sv, arg);
break;
}
case INSN_XIV: /* 25 */
{
IV arg;
BGET_IV(arg);
- SvIVX(bstate->bs_sv) = arg;
+ BSET_xiv(bstate->bs_sv, arg);
break;
}
case INSN_XNV: /* 26 */
{
NV arg;
BGET_NV(arg);
- SvNVX(bstate->bs_sv) = arg;
+ BSET_xnv(bstate->bs_sv, arg);
break;
}
case INSN_XLV_TARGOFF: /* 27 */
@@ -592,7 +593,7 @@ byterun(pTHX_ register struct byteloader_state *bstate)
{
svindex arg;
BGET_svindex(arg);
- *(SV**)&SvSTASH(bstate->bs_sv) = arg;
+ bstate->bs_sv = arg;
break;
}
case INSN_GV_FETCHPV: /* 77 */
View
4 ext/Data/Dumper/Dumper.xs
@@ -830,8 +830,8 @@ DD_dump(pTHX_ SV *val, char *name, STRLEN namelen, SV *retval, HV *seenhv,
SvCUR_set(retval, SvCUR(retval)+i);
if (purity) {
- static char *entries[] = { "{SCALAR}", "{ARRAY}", "{HASH}" };
- static STRLEN sizes[] = { 8, 7, 6 };
+ static const char* const entries[] = { "{SCALAR}", "{ARRAY}", "{HASH}" };
+ static const STRLEN sizes[] = { 8, 7, 6 };
SV *e;
SV *nname = newSVpvn("", 0);
SV *newapad = newSVpvn("", 0);
View
18 ext/Digest/MD5/MD5.xs
@@ -153,7 +153,7 @@ typedef struct {
* padding is also the reason the buffer in MD5_CTX have to be
* 128 bytes.
*/
-static unsigned char PADDING[64] = {
+static const unsigned char PADDING[64] = {
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
@@ -484,7 +484,7 @@ static MD5_CTX* get_md5_ctx(pTHX_ SV* sv)
static char* hex_16(const unsigned char* from, char* to)
{
- static char *hexdigits = "0123456789abcdef";
+ static const char hexdigits[] = "0123456789abcdef";
const unsigned char *end = from + 16;
char *d = to;
@@ -499,7 +499,7 @@ static char* hex_16(const unsigned char* from, char* to)
static char* base64_16(const unsigned char* from, char* to)
{
- static char* base64 =
+ static const char base64[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
const unsigned char *end = from + 16;
unsigned char c1, c2, c3;
@@ -626,10 +626,18 @@ addfile(self, fh)
PREINIT:
MD5_CTX* context = get_md5_ctx(aTHX_ self);
STRLEN fill = context->bytes_low & 0x3F;
+#ifdef USE_HEAP_INSTEAD_OF_STACK
+ unsigned char* buffer;
+#else
unsigned char buffer[4096];
+#endif
int n;
CODE:
if (fh) {
+#ifdef USE_HEAP_INSTEAD_OF_STACK
+ New(0, buffer, 4096, unsigned char);
+ assert(buffer);
+#endif
if (fill) {
/* The MD5Update() function is faster if it can work with
* complete blocks. This will fill up any buffered block
@@ -646,7 +654,9 @@ addfile(self, fh)
while ( (n = PerlIO_read(fh, buffer, sizeof(buffer))) > 0) {
MD5Update(context, buffer, n);
}
-
+#ifdef USE_HEAP_INSTEAD_OF_STACK
+ Safefree(buffer);
+#endif
if (PerlIO_error(fh)) {
croak("Reading from filehandle failed");
}
View
6 ext/Digest/MD5/t/files.t
@@ -23,7 +23,7 @@ if (ord "A" == 193) { # EBCDIC
15e4c91ad67f5ff238033305376c9140 Changes
0565ec21b15c0f23f4c51fb327c8926d README
f0f77710cd8d5ba7d9faedec8d02dc2f MD5.pm
-f9848c0ee3b20a9177465eec19361e6c MD5.xs
+f6314d62d3aa97dcf4cba66b4c39b105 MD5.xs
276da0aa4e9a08b7fe09430c9c5690aa rfc1321.txt
EOT
} elsif ("\n" eq "\015") { # MacOS
@@ -31,7 +31,7 @@ EOT
dea016b088ab4d88a5e7cbd9c15a9c88 Changes
6c950a0211a5a28f023bb482037698cd README
f057c88277ecee875cf6f0352468407a MD5.pm
-5bae62404829e6fd8ad0d4f8d5ccea54 MD5.xs
+a526b0218e43c702a6c994a82620686f MD5.xs
754b9db19f79dbc4992f7166eb0f37ce rfc1321.txt
EOT
} else {
@@ -40,7 +40,7 @@ EOT
0f09886e2c129bdabf57674c6822bd4f Changes
6c950a0211a5a28f023bb482037698cd README
f057c88277ecee875cf6f0352468407a MD5.pm
-5bae62404829e6fd8ad0d4f8d5ccea54 MD5.xs
+a526b0218e43c702a6c994a82620686f MD5.xs
754b9db19f79dbc4992f7166eb0f37ce rfc1321.txt
EOT
}
View
19 ext/DynaLoader/DynaLoader_pm.PL
@@ -26,6 +26,10 @@ sub to_string {
#
# -- added by VKON, 03-10-2004 to separate $^O-specific between OSes
# (so that Win32 never checks for $^O eq 'VMS' for example)
+#
+# The $^O tests test both for $^O and for $Config{osname}.
+# The latter is better for some for cross-compilation setups.
+#
sub expand_os_specific {
my $s = shift;
for ($s) {
@@ -36,7 +40,7 @@ sub expand_os_specific {
if ($expr =~ m[^(.*?)<<\|\$\^O-$op-$os>>(.*?)$]s) {
# #if;#else;#endif
my ($if,$el) = ($1,$2);
- if (($op eq 'eq' and $^O eq $os) || ($op eq 'ne' and $^O ne $os)) {
+ if (($op eq 'eq' and ($^O eq $os || $Config{osname} eq $os)) || ($op eq 'ne' and ($^O ne $os || $Config{osname} ne $os))) {
$if
}
else {
@@ -45,7 +49,7 @@ sub expand_os_specific {
}
else {
# #if;#endif
- if (($op eq 'eq' and $^O eq $os) || ($op eq 'ne' and $^O ne $os)) {
+ if (($op eq 'eq' and ($^O eq $os || $Config{osname} eq $os)) || ($op eq 'ne' and ($^O ne $os || $Config{osname} ne $os))) {
$expr
}
else {
@@ -496,13 +500,22 @@ sub dl_findfile {
push(@names,"$_.a") if !m/\.a$/ and $dlsrc eq "dl_dld.xs";
push(@names, $_);
}
+ my $dirsep = '/';
+ <<$^O-eq-symbian>>
+ $dirsep = '\\';
+ if ($0 =~ /^([a-z]):/i) {
+ my $drive = $1;
+ @dirs = map { "$drive:$_" } @dirs;
+ @dl_library_path = map { "$drive:$_" } @dl_library_path;
+ }
+ <</$^O-eq-symbian>>
foreach $dir (@dirs, @dl_library_path) {
next unless -d $dir;
<<$^O-eq-VMS>>
chop($dir = VMS::Filespec::unixpath($dir));
<</$^O-eq-VMS>>
foreach $name (@names) {
- my($file) = "$dir/$name";
+ my($file) = "$dir$dirsep$name";
print STDERR " checking in $dir for $name\n" if $dl_debug;
$file = ($do_expand) ? dl_expandspec($file) : (-f $file && $file);
#$file = _check_file($file);
View
223 ext/DynaLoader/dl_symbian.xs
@@ -0,0 +1,223 @@
+/* dl_symbian.xs
+ *
+ * Platform: Symbian 7.0s
+ * Author: Jarkko Hietaniemi <jarkko.hietaniemi@nokia.com>
+ * Copyright: 2004, Nokia
+ * License: Artistic/GPL
+ *
+ */
+
+/*
+ * In Symbian DLLs there is no name information, one can only access
+ * the functions by their ordinals. Perl, however, very much would like
+ * to load functions by their names. We fake this by having a special
+ * setup function at the ordinal 1 (this is arranged by building the DLLs
+ * in a special way). The setup function builds a Perl hash mapping the
+ * names to the ordinals, and the hash is then used by dlsym().
+ *
+ */
+
+#include <e32base.h>
+#include <eikdll.h>
+#include <utf.h>
+
+/* This is a useful pattern: first include the Symbian headers,
+ * only after that the Perl ones. Otherwise you will get a lot
+ * trouble because of Symbian's New(), Copy(), etc definitions. */
+
+#define DL_SYMBIAN_XS
+
+#include "EXTERN.h"
+#include "perl.h"
+#include "XSUB.h"
+
+START_EXTERN_C
+
+void *dlopen(const char *filename, int flag);
+void *dlsym(void *handle, const char *symbol);
+int dlclose(void *handle);
+const char *dlerror(void);
+
+extern void* memset(void *s, int c, size_t n);
+extern size_t strlen(const char *s);
+
+END_EXTERN_C
+
+#include "dlutils.c"
+
+#define RTLD_LAZY 0x0001
+#define RTLD_NOW 0x0002
+#define RTLD_GLOBAL 0x0004
+
+#ifndef NULL
+# define NULL 0
+#endif
+
+/* No need to pull in symbian_dll.cpp for this. */
+#define symbian_get_vars() ((void*)Dll::Tls())
+
+const TInt KPerlDllSetupFunction = 1;
+
+typedef struct {
+ RLibrary handle;
+ TInt error;
+ HV* symbols;
+} PerlSymbianLibHandle;
+
+typedef void (*PerlSymbianLibInit)(void *);
+
+void* dlopen(const char *filename, int flags) {
+ TBuf16<KMaxFileName> utf16fn;
+ const TUint8* utf8fn = (const TUint8*)filename;
+ PerlSymbianLibHandle* h = NULL;
+ TInt error;
+
+ error =
+ CnvUtfConverter::ConvertToUnicodeFromUtf8(utf16fn, TPtrC8(utf8fn));
+ if (error == KErrNone) {
+ h = new PerlSymbianLibHandle;
+ if (h) {
+ h->error = KErrNone;
+ h->symbols = Nullhv;
+ } else
+ error = KErrNoMemory;
+ }
+
+ if (h && error == KErrNone) {
+ error = (h->handle).Load(utf16fn);
+ if (error == KErrNone) {
+ TLibraryFunction init = (h->handle).Lookup(KPerlDllSetupFunction);
+ ((PerlSymbianLibInit)init)(h);
+ } else {
+ free(h);
+ h = NULL;
+ }
+ }
+
+ if (h)
+ h->error = error;
+
+ return h;
+}
+
+void* dlsym(void *handle, const char *symbol) {
+ if (handle) {
+ dTHX;
+ PerlSymbianLibHandle* h = (PerlSymbianLibHandle*)handle;
+ HV* symbols = h->symbols;
+ if (symbols) {
+ SV** svp = hv_fetch(symbols, symbol, strlen(symbol), FALSE);
+ if (svp && *svp && SvIOK(*svp)) {
+ IV ord = SvIV(*svp);
+ if (ord > 0)
+ return (void*)((h->handle).Lookup(ord));
+ }
+ }
+ }
+ return NULL;
+}
+
+int dlclose(void *handle) {
+ PerlSymbianLibHandle* h = (PerlSymbianLibHandle*)handle;
+ if (h) {
+ (h->handle).Close();
+ if (h->symbols) {
+ dTHX;
+ hv_undef(h->symbols);
+ h->symbols = NULL;
+ }
+ return 0;
+ } else
+ return 1;
+}
+
+const char* dlerror(void) {
+ return 0; /* Bad interface: assumes static data. */
+}
+
+static void
+dl_private_init(pTHX)
+{
+ (void)dl_generic_private_init(aTHX);
+}
+
+MODULE = DynaLoader PACKAGE = DynaLoader
+
+PROTOTYPES: ENABLE
+
+BOOT:
+ (void)dl_private_init(aTHX);
+
+
+void
+dl_load_file(filename, flags=0)
+ char * filename
+ int flags
+ PREINIT:
+ PerlSymbianLibHandle* h;
+ CODE:
+{
+ ST(0) = sv_newmortal();
+ h = (PerlSymbianLibHandle*)dlopen(filename, flags);
+ if (h && h->error == KErrNone)
+ sv_setiv(ST(0), PTR2IV(h));
+ else
+ PerlIO_printf(Perl_debug_log, "(dl_load_file %s %d)",
+ filename, h ? h->error : -1);
+}
+
+
+int
+dl_unload_file(libhandle)
+ void * libhandle
+ CODE:
+ RETVAL = (dlclose(libhandle) == 0 ? 1 : 0);
+ OUTPUT:
+ RETVAL
+
+
+void
+dl_find_symbol(libhandle, symbolname)
+ void * libhandle
+ char * symbolname
+ PREINIT:
+ void *sym;
+ CODE:
+ PerlSymbianLibHandle* h = (PerlSymbianLibHandle*)libhandle;
+ sym = dlsym(libhandle, symbolname);
+ ST(0) = sv_newmortal();
+ if (sym)
+ sv_setiv(ST(0), PTR2IV(sym));
+ else
+ PerlIO_printf(Perl_debug_log, "(dl_find_symbol %s %d)",
+ symbolname, h ? h->error : -1);
+
+
+void
+dl_undef_symbols()
+ CODE:
+
+
+
+# These functions should not need changing on any platform:
+
+void
+dl_install_xsub(perl_name, symref, filename="$Package")
+ char * perl_name
+ void * symref
+ char * filename
+ CODE:
+ ST(0) = sv_2mortal(newRV((SV*)newXS(perl_name,
+ (void(*)(pTHX_ CV *))symref,
+ filename)));
+
+
+char *
+dl_error()
+ CODE:
+ dMY_CXT;
+ RETVAL = dl_last_error;
+ OUTPUT:
+ RETVAL
+
+# end.
View
8 ext/DynaLoader/dlutils.c
@@ -8,6 +8,12 @@
* files when the interpreter exits
*/
+#ifndef START_MY_CXT /* Some IDEs try compiling this standalone. */
+# include "EXTERN.h"
+# include "perl.h"
+# include "XSUB.h"
+#endif
+
#ifndef XS_VERSION
# define XS_VERSION "0"
#endif
@@ -110,6 +116,7 @@ dl_generic_private_init(pTHX) /* called by dl_*.xs dl_private_init() */
}
+#ifndef SYMBIAN
/* SaveError() takes printf style args and saves the result in dl_last_error */
static void
SaveError(pTHX_ const char* pat, ...)
@@ -133,4 +140,5 @@ SaveError(pTHX_ const char* pat, ...)
sv_setpvn(MY_CXT.x_dl_last_error, message, len) ;
DLDEBUG(2,PerlIO_printf(Perl_debug_log, "DynaLoader: stored error msg '%s'\n",dl_last_error));
}
+#endif
View
34 ext/Errno/Errno_pm.PL
@@ -7,6 +7,11 @@ our $VERSION = "1.09_01";
my %err = ();
my %wsa = ();
+# Symbian cross-compiling environment.
+my $IsSymbian = exists $ENV{SDK} && -d "$ENV{SDK}\\epoc32";
+
+my $IsMSWin32 = $^O eq 'MSWin32' && !$IsSymbian;
+
unlink "Errno.pm" if -f "Errno.pm";
open OUT, ">Errno.pm" or die "Cannot open Errno.pm: $!";
select OUT;
@@ -27,7 +32,7 @@ sub process_file {
}
return unless defined $file and -f $file;
-# warn "Processing $file\n";
+# warn "Processing $file\n";
local *FH;
if (($^O eq 'VMS') && ($Config{vms_cc_type} ne 'gnuc')) {
@@ -53,7 +58,7 @@ sub process_file {
return;
}
}
-
+
if ($^O eq 'MacOS') {
while(<FH>) {
$err{$1} = $2
@@ -63,12 +68,13 @@ sub process_file {
while(<FH>) {
$err{$1} = 1
if /^\s*#\s*define\s+(E\w+)\s+/;
- if ($^O eq 'MSWin32') {
+ if ($IsMSWin32) {
$wsa{$1} = 1
if /^\s*#\s*define\s+WSA(E\w+)\s+/;
}
}
}
+
close(FH);
}
@@ -130,6 +136,10 @@ sub get_files {
} elsif ($^O eq 'vos') {
# avoid problem where cpp returns non-POSIX pathnames
$file{'/system/include_library/errno.h'} = 1;
+ } elsif ($IsSymbian) {
+ my $SDK = $ENV{SDK};
+ $SDK =~ s!\\!/!g;
+ $file{"$SDK/epoc32/include/libc/sys/errno.h"} = 1;
} else {
open(CPPI,"> errno.c") or
die "Cannot open errno.c";
@@ -138,7 +148,7 @@ sub get_files {
print CPPI "#include <nwerrno.h>\n";
} else {
print CPPI "#include <errno.h>\n";
- if ($^O eq 'MSWin32') {
+ if ($IsMSWin32) {
print CPPI "#define _WINSOCKAPI_\n"; # don't drag in everything
print CPPI "#include <winsock.h>\n";
}
@@ -147,7 +157,7 @@ sub get_files {
close(CPPI);
# invoke CPP and read the output
- if ($^O eq 'MSWin32' || $^O eq 'NetWare') {
+ if ($IsMSWin32 || $^O eq 'NetWare') {
open(CPPO,"$Config{cpprun} $Config{cppflags} errno.c |") or
die "Cannot run '$Config{cpprun} $Config{cppflags} errno.c'";
} else {
@@ -157,14 +167,14 @@ sub get_files {
}
my $pat;
- if (($^O eq 'MSWin32' || $^O eq 'NetWare') and $Config{cc} =~ /^bcc/i) {
+ if (($IsMSWin32 || $^O eq 'NetWare') and $Config{cc} =~ /^bcc/i) {
$pat = '^/\*\s+(.+)\s+\d+\s*:\s+\*/';
}
else {
$pat = '^#\s*(?:line)?\s*\d+\s+"([^"]+)"';
}
while(<CPPO>) {
- if ($^O eq 'os2' or $^O eq 'MSWin32' or $^O eq 'NetWare') {
+ if ($^O eq 'os2' or $IsMSWin32 or $^O eq 'NetWare') {
if (/$pat/o) {
my $f = $1;
$f =~ s,\\\\,/,g;
@@ -198,7 +208,7 @@ sub write_errno_pm {
else {
print CPPI "#include <errno.h>\n";
}
- if ($^O eq 'MSWin32') {
+ if ($IsMSWin32) {
print CPPI "#include <winsock.h>\n";
foreach $err (keys %wsa) {
print CPPI "#ifndef $err\n";
@@ -222,10 +232,14 @@ sub write_errno_pm {
$cpp =~ s/sys\$input//i;
open(CPPO,"$cpp errno.c |") or
die "Cannot exec $Config{cppstdin}";
- } elsif ($^O eq 'MSWin32' || $^O eq 'NetWare') {
+ } elsif ($IsMSWin32 || $^O eq 'NetWare') {
open(CPPO,"$Config{cpprun} $Config{cppflags} errno.c |") or
die "Cannot run '$Config{cpprun} $Config{cppflags} errno.c'";
- } else {
+ } elsif ($IsSymbian) {
+ my $cpp = "gcc -E -I$ENV{SDK}\\epoc32\\include\\libc -";
+ open(CPPO,"$cpp < errno.c |")
+ or die "Cannot exec $cpp";
+ } else {
my $cpp = default_cpp();
open(CPPO,"$cpp < errno.c |")
or die "Cannot exec $cpp";
View
2  ext/IO/lib/IO/Socket.pm
@@ -19,7 +19,7 @@ use Errno;
# legacy
require IO::Socket::INET;
-require IO::Socket::UNIX if ($^O ne 'epoc');
+require IO::Socket::UNIX if ($^O ne 'epoc' && $^O ne 'symbian');
@ISA = qw(IO::Handle);
View
21 ext/List/Util/Util.xs
@@ -103,6 +103,24 @@ sv_tainted(SV *sv)
# define PTR2UV(ptr) (UV)(ptr)
#endif
+#ifdef HASATTRIBUTE
+# if (defined(__GNUC__) && defined(__cplusplus)) || defined(__INTEL_COMPILER)
+# define PERL_UNUSED_DECL
+# else
+# define PERL_UNUSED_DECL __attribute__((unused))
+# endif
+#else
+# define PERL_UNUSED_DECL
+#endif
+
+#ifndef dNOOP
+#define dNOOP extern int Perl___notused PERL_UNUSED_DECL
+#endif
+
+#ifndef dVAR
+#define dVAR dNOOP
+#endif
+
MODULE=List::Util PACKAGE=List::Util
void
@@ -206,6 +224,7 @@ reduce(block,...)
PROTOTYPE: &@
CODE:
{
+ dVAR;
SV *ret = sv_newmortal();
int index;
GV *agv,*bgv,*gv;
@@ -261,6 +280,7 @@ first(block,...)
PROTOTYPE: &@
CODE:
{
+ dVAR;
int index;
GV *gv;
HV *stash;
@@ -315,6 +335,7 @@ shuffle(...)
PROTOTYPE: @
CODE:
{
+ dVAR;
int index;
struct op dmy_op;
struct op *old_op = PL_op;
View
4 ext/MIME/Base64/Base64.xs
@@ -56,14 +56,14 @@ extern "C" {
#define MAX_LINE 76 /* size of encoded lines */
-static char basis_64[] =
+static const char basis_64[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
#define XX 255 /* illegal base64 char */
#define EQ 254 /* padding */
#define INVALID XX
-static unsigned char index_64[256] = {
+static const unsigned char index_64[256] = {
XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX,
XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,XX,
XX,XX,XX,XX, XX,XX,XX,XX, XX,XX,XX,62, XX,XX,XX,63,
View
24 ext/POSIX/POSIX.xs
@@ -85,6 +85,24 @@ char *tzname[] = { "" , "" };
#endif
#endif
+#ifdef HASATTRIBUTE
+# if (defined(__GNUC__) && defined(__cplusplus)) || defined(__INTEL_COMPILER)
+# define PERL_UNUSED_DECL
+# else
+# define PERL_UNUSED_DECL __attribute__((unused))
+# endif
+#else
+# define PERL_UNUSED_DECL
+#endif
+
+#ifndef dNOOP
+#define dNOOP extern int Perl___notused PERL_UNUSED_DECL
+#endif
+
+#ifndef dVAR
+#define dVAR dNOOP
+#endif
+
#if defined(__VMS) && !defined(__POSIX_SOURCE)
# include <libdef.h> /* LIB$_INVARG constant */
# include <lib$routines.h> /* prototype for lib$ediv() */
@@ -189,7 +207,9 @@ char *tzname[] = { "" , "" };
# define ttyname(a) (char*)not_here("ttyname")
# define tzset() not_here("tzset")
# else
-# include <grp.h>
+# ifdef I_GRP
+# include <grp.h>
+# endif
# include <sys/times.h>
# ifdef HAS_UNAME
# include <sys/utsname.h>
@@ -602,7 +622,6 @@ sigismember(sigset, sig)
POSIX::SigSet sigset
int sig
-
MODULE = Termios PACKAGE = POSIX::Termios PREFIX = cf
POSIX::Termios
@@ -1228,6 +1247,7 @@ sigaction(sig, optaction, oldaction = 0)
# interface look beautiful, which is hard.
{
+ dVAR;
POSIX__SigAction action;
GV *siggv = gv_fetchpv("SIG", TRUE, SVt_PVHV);
struct sigaction act;
View
4 ext/PerlIO/scalar/scalar.xs
@@ -254,7 +254,7 @@ PerlIOScalar_dup(pTHX_ PerlIO * f, PerlIO * o, CLONE_PARAMS * param,
return f;
}
-PerlIO_funcs PerlIO_scalar = {
+PERLIO_FUNCS_DECL(PerlIO_scalar) = {
sizeof(PerlIO_funcs),
"scalar",
sizeof(PerlIOScalar),
@@ -295,7 +295,7 @@ PROTOTYPES: ENABLE
BOOT:
{
#ifdef PERLIO_LAYERS
- PerlIO_define_layer(aTHX_ &PerlIO_scalar);
+ PerlIO_define_layer(aTHX_ PERLIO_FUNCS_CAST(&PerlIO_scalar));
#endif
}
View
4 ext/PerlIO/via/via.xs
@@ -590,7 +590,7 @@ PerlIOVia_dup(pTHX_ PerlIO * f, PerlIO * o, CLONE_PARAMS * param,
-PerlIO_funcs PerlIO_object = {
+PERLIO_FUNCS_DECL(PerlIO_object) = {
sizeof(PerlIO_funcs),
"via",
sizeof(PerlIOVia),
@@ -630,7 +630,7 @@ PROTOTYPES: ENABLE;
BOOT:
{
#ifdef PERLIO_LAYERS
- PerlIO_define_layer(aTHX_ &PerlIO_object);
+ PerlIO_define_layer(aTHX_ PERLIO_FUNCS_CAST(&PerlIO_object));
#endif
}
View
2  ext/SDBM_File/sdbm/sdbm.c
@@ -62,7 +62,7 @@ static int makroom proto((DBM *, long, int));
#define OFF_PAG(off) (long) (off) * PBLKSIZ
#define OFF_DIR(off) (long) (off) * DBLKSIZ
-static long masks[] = {
+static const long masks[] = {
000000000000, 000000000001, 000000000003, 000000000007,
000000000017, 000000000037, 000000000077, 000000000177,
000000000377, 000000000777, 000000001777, 000000003777,
View
172 ext/Storable/Storable.xs
@@ -93,6 +93,24 @@ typedef double NV; /* Older perls lack the NV type */
#endif
#endif
+#ifdef HASATTRIBUTE
+# if (defined(__GNUC__) && defined(__cplusplus)) || defined(__INTEL_COMPILER)
+# define PERL_UNUSED_DECL
+# else
+# define PERL_UNUSED_DECL __attribute__((unused))
+# endif
+#else
+# define PERL_UNUSED_DECL
+#endif
+
+#ifndef dNOOP
+#define dNOOP extern int Perl___notused PERL_UNUSED_DECL
+#endif
+
+#ifndef dVAR
+#define dVAR dNOOP
+#endif
+
#ifdef DEBUGME
#ifndef DASSERT
@@ -1024,15 +1042,17 @@ static int store_code(pTHX_ stcxt_t *cxt, CV *cv);
static int store_other(pTHX_ stcxt_t *cxt, SV *sv);
static int store_blessed(pTHX_ stcxt_t *cxt, SV *sv, int type, HV *pkg);
-static int (*sv_store[])(pTHX_ stcxt_t *cxt, SV *sv) = {
- store_ref, /* svis_REF */
- store_scalar, /* svis_SCALAR */
- (int (*)(pTHX_ stcxt_t *cxt, SV *sv)) store_array, /* svis_ARRAY */
- (int (*)(pTHX_ stcxt_t *cxt, SV *sv)) store_hash, /* svis_HASH */
- store_tied, /* svis_TIED */
- store_tied_item, /* svis_TIED_ITEM */
- (int (*)(pTHX_ stcxt_t *cxt, SV *sv)) store_code, /* svis_CODE */
- store_other, /* svis_OTHER */
+#define SV_STORE_TYPE (const int (* const)(pTHX_ stcxt_t *cxt, SV *sv))
+
+static const int (* const sv_store[])(pTHX_ stcxt_t *cxt, SV *sv) = {
+ SV_STORE_TYPE store_ref, /* svis_REF */
+ SV_STORE_TYPE store_scalar, /* svis_SCALAR */
+ SV_STORE_TYPE store_array, /* svis_ARRAY */
+ SV_STORE_TYPE store_hash, /* svis_HASH */
+ SV_STORE_TYPE store_tied, /* svis_TIED */
+ SV_STORE_TYPE store_tied_item, /* svis_TIED_ITEM */
+ SV_STORE_TYPE store_code, /* svis_CODE */
+ SV_STORE_TYPE store_other, /* svis_OTHER */
};
#define SV_STORE(x) (*sv_store[x])
@@ -1058,37 +1078,39 @@ static SV *retrieve_tied_hash(pTHX_ stcxt_t *cxt, char *cname);
static SV *retrieve_tied_scalar(pTHX_ stcxt_t *cxt, char *cname);
static SV *retrieve_other(pTHX_ stcxt_t *cxt, char *cname);
-static SV *(*sv_old_retrieve[])(pTHX_ stcxt_t *cxt, char *cname) = {
- 0, /* SX_OBJECT -- entry unused dynamically */
- retrieve_lscalar, /* SX_LSCALAR */
- old_retrieve_array, /* SX_ARRAY -- for pre-0.6 binaries */
- old_retrieve_hash, /* SX_HASH -- for pre-0.6 binaries */
- retrieve_ref, /* SX_REF */
- retrieve_undef, /* SX_UNDEF */