/* HP-UX 10.X CMA (Common Multithreaded Architecure) insists that
pthread.h must be included before all other header files.
*/
-#if defined(USE_THREADS) && defined(PTHREAD_H_FIRST)
+#if defined(USE_THREADS) && defined(PTHREAD_H_FIRST) && defined(I_PTHREAD)
# include <pthread.h>
#endif
#ifdef USE_THREADS
# define ERRSV (thr->errsv)
-# define ERRHV (thr->errhv)
# define DEFSV THREADSV(0)
# define SAVE_DEFSV save_threadsv(0)
#else
# define ERRSV GvSV(PL_errgv)
-# define ERRHV GvHV(PL_errgv)
# define DEFSV GvSV(PL_defgv)
# define SAVE_DEFSV SAVESPTR(GvSV(PL_defgv))
#endif /* USE_THREADS */
+#define ERRHV GvHV(PL_errgv) /* XXX unused, here for compatibility */
+
#ifndef errno
extern int errno; /* ANSI allows errno to be an lvalue expr.
* For example in multithreaded environments
# define IVSIZE LONGSIZE
#endif
#define IV_DIG (BIT_DIGITS(IVSIZE * 8))
-#define UV_DIG (BIT_DIGITS(IVSIZE * 8))
+#define UV_DIG (BIT_DIGITS(UVSIZE * 8))
/*
* The macros INT2PTR and NUM2PTR are (despite their names)
#include "handy.h"
-#ifdef USE_64_BITS
-# define USE_64_BIT_FILES
-#endif
-
-#if defined(USE_64_BIT_FILES) || defined(USE_LARGE_FILES)
-# define USE_64_BIT_OFFSETS /* Explicit */
+#if defined(USE_LARGE_FILES)
+# define USE_64_BIT_RAWIO /* Explicit */
# define USE_64_BIT_STDIO
#endif
-#if LSEEKSIZE == 8 && !defined(USE_64_BIT_OFFSETS)
-# define USE_64_BIT_OFFSETS /* Implicit */
+#if LSEEKSIZE == 8 && !defined(USE_64_BIT_RAWIO)
+# define USE_64_BIT_RAWIO /* Implicit */
#endif
/* Do we need FSEEKSIZE? */
#define USE_FREOPEN64
#endif
-#ifdef USE_64_BIT_OFFSETS
+#ifdef USE_64_BIT_RAWIO
# ifdef HAS_OFF64_T
# undef Off_t
# define Off_t off64_t
# endif
/* Most 64-bit environments have defines like _LARGEFILE_SOURCE that
* will trigger defines like the ones below. Some 64-bit environments,
- * however, do not. */
+ * however, do not. Therefore we have to explicitly mix and match. */
# if defined(USE_OPEN64)
# define open open64
# endif
typedef condition_t perl_cond;
typedef void * perl_key;
# else /* Posix threads */
-# include <pthread.h>
+# ifdef I_PTHREAD
+# include <pthread.h>
+# endif
typedef pthread_t perl_os_thread;
typedef pthread_mutex_t perl_mutex;
typedef pthread_cond_t perl_cond;
I32 any_i32;
IV any_iv;
long any_long;
- void (*any_dptr) (pTHXo_ void*);
+ void (*any_dptr) (void*);
+ void (*any_dxptr) (pTHXo_ void*);
};
#endif
# endif
#endif
+#ifdef IV_IS_QUAD
+# define UVuf PERL_PRIu64
+# define IVdf PERL_PRId64
+# define UVof PERL_PRIo64
+# define UVxf PERL_PRIx64
+#else
+# if LONGSIZE == 4
+# define UVuf "lu"
+# define IVdf "ld"
+# define UVof "lo"
+# define UVxf "lx"
+# else
+ /* Any good ideas? */
+# endif
+#endif
+
/* Used with UV/IV arguments: */
/* XXXX: need to speed it up */
#define CLUMP_2UV(iv) ((iv) < 0 ? 0 : (UV)(iv))
#endif
#ifndef Perl_debug_log
-#define Perl_debug_log PerlIO_stderr()
+# define Perl_debug_log PerlIO_stderr()
+#endif
+
+#ifndef Perl_error_log
+# define Perl_error_log (PL_stderrgv \
+ ? IoOFP(GvIOp(PL_stderrgv)) \
+ : PerlIO_stderr())
#endif
#ifdef DEBUGGING
int Perl_yylex(pTHX_ YYSTYPE *lvalp, int *lcharp);
#endif
+typedef void (*DESTRUCTORFUNC_NOCONTEXT_t) (void*);
typedef void (*DESTRUCTORFUNC_t) (pTHXo_ void*);
typedef void (*SVFUNC_t) (pTHXo_ SV*);
typedef I32 (*SVCOMPARE_t) (pTHXo_ SV*, SV*);
# include <sys/sem.h>
# ifndef HAS_UNION_SEMUN /* Provide the union semun. */
union semun {
- int val;
- struct semid_ds *buf;
- unsigned short *array;
+ int val;
+ struct semid_ds *buf;
+ unsigned short *array;
};
# endif
# ifdef USE_SEMCTL_SEMUN
+# ifdef IRIX32_SEMUN_BROKEN_BY_GCC
+ union gccbug_semun {
+ int val;
+ struct semid_ds *buf;
+ unsigned short *array;
+ char __dummy[5];
+ };
+# define semun gccbug_semun
+# endif
# define Semctl(id, num, cmd, semun) semctl(id, num, cmd, semun)
# else
# ifdef USE_SEMCTL_SEMID_DS