#define CALLREG_INTUIT_STRING CALL_FPTR(PL_regint_string)
#define CALLREGFREE CALL_FPTR(PL_regfree)
-#define PERL_UNUSED_DECL __attribute__unused__
+#if defined(SYMBIAN) && defined(__GNUC__)
+# ifdef __cplusplus
+# define PERL_UNUSED_DECL
+# else
+# define PERL_UNUSED_DECL __attribute__((unused))
+# endif
+#endif
+#ifndef PERL_UNUSED_DECL
+# ifdef HASATTRIBUTE_UNUSED
+# define PERL_UNUSED_DECL __attribute__unused__
+# else
+# define PERL_UNUSED_DECL
+# endif
+#endif
+
/* gcc -Wall:
* for silencing unused variables that are actually used most of the time,
- * but we cannot quite get rid of, such `ax' in PPCODE+noargs xsubs
+ * but we cannot quite get rid of, such as "ax" in PPCODE+noargs xsubs
*/
#define PERL_UNUSED_VAR(var) ((void)var)
*/
#if !(defined(STMT_START) && defined(STMT_END))
# if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) && !defined(__cplusplus)
-# define STMT_START (void)( /* gcc supports ``({ STATEMENTS; })'' */
+# define STMT_START (void)( /* gcc supports "({ STATEMENTS; })" */
# define STMT_END )
# else
/* Now which other defined()s do we need here ??? */
#define MEM_SIZE Size_t
+/* Round all values passed to malloc up, by default to a multiple of
+ sizeof(size_t)
+*/
+#ifndef PERL_STRLEN_ROUNDUP_QUANTUM
+#define PERL_STRLEN_ROUNDUP_QUANTUM Size_t_size
+#endif
+
#if defined(STANDARD_C) && defined(I_STDDEF)
# include <stddef.h>
# define STRUCT_OFFSET(s,m) offsetof(s,m)
# define PTR2ul(p) INT2PTR(unsigned long,p)
#endif
+/* According to strict ANSI C89 one cannot freely cast between
+ * data pointers and function (code) pointers. There are at least
+ * two ways around this. One (used below) is to do two casts,
+ * first the other pointer to an (unsigned) integer, and then
+ * the integer to the other pointer. The other way would be
+ * to use unions to "overlay" the pointers. For an example of
+ * the latter technique, see union dirpu in struct xpvio in sv.h.
+ * The only feasible use is probably temporarily storing
+ * function pointers in a data pointer (such as a void pointer). */
+
+#define DPTR2FPTR(t,p) ((t)PTR2UV(p)) /* data pointer to function pointer */
+#define FPTR2DPTR(t,p) ((t)PTR2UV(p)) /* function pointer to data pointer */
+
#ifdef USE_LONG_DOUBLE
# if defined(HAS_LONG_DOUBLE) && LONG_DOUBLESIZE == DOUBLESIZE
# define LONG_DOUBLE_EQUALS_DOUBLE
typedef struct block BLOCK;
typedef struct magic MAGIC;
-typedef struct xrv XRV;
typedef struct xpv XPV;
typedef struct xpviv XPVIV;
typedef struct xpvuv XPVUV;
#define PERL_MAGIC_arylen '#' /* Array length ($#ary) */
#define PERL_MAGIC_pos '.' /* pos() lvalue */
#define PERL_MAGIC_backref '<' /* for weak ref data */
+#define PERL_MAGIC_symtab ':' /* extra data for symbol tables */
+#define PERL_MAGIC_rhash '%' /* extra data for restricted hashes */
+#define PERL_MAGIC_arylen_p '@' /* to move arylen out of XPVAV */
#define PERL_MAGIC_ext '~' /* Available for use by extensions */
#ifndef assert /* <assert.h> might have been included somehow */
#define assert(what) PERL_DEB( \
((what) ? ((void) 0) : \
- (Perl_croak(aTHX_ "Assertion " STRINGIFY(what) " failed: file \"%s\", line %d", \
- __FILE__, __LINE__), \
+ (Perl_croak(aTHX_ "Assertion %s failed: file \"" __FILE__ \
+ "\", line %d", STRINGIFY(what), __LINE__), \
PerlProc_exit(1), \
(void) 0)))
#endif
want_vtbl_regdata,
want_vtbl_regdatum,
want_vtbl_backref,
- want_vtbl_utf8
+ want_vtbl_utf8,
+ want_vtbl_symtab,
+ want_vtbl_arylen_p
};
/* Note: the lowest 8 bits are reserved for
#endif
#undef PERL_CKDEF
#undef PERL_PPDEF
-#define PERL_CKDEF(s) OP *s (pTHX_ OP *o);
-#define PERL_PPDEF(s) OP *s (pTHX);
+#define PERL_CKDEF(s) PERL_CALLCONV OP *s (pTHX_ OP *o);
+#define PERL_PPDEF(s) PERL_CALLCONV OP *s (pTHX);
#include "proto.h"
);
MGVTBL_SET(
+ PL_vtbl_arylen_p,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ MEMBER_TO_FPTR(Perl_magic_freearylen_p),
+ NULL,
+ NULL
+);
+
+MGVTBL_SET(
PL_vtbl_glob,
MEMBER_TO_FPTR(Perl_magic_getglob),
MEMBER_TO_FPTR(Perl_magic_setglob),
* but also beware since this evaluates its argument twice, so no x++. */
#define PERL_ABS(x) ((x) < 0 ? -(x) : (x))
-#ifdef __osf__
-#pragma message disable (mainparm) /* We have the envp in main(). */
+#if defined(__DECC) && defined(__osf__)
+#pragma message disable (mainparm) /* Perl uses the envp in main(). */
#endif
/* and finally... */