summaryrefslogtreecommitdiff
path: root/perl.h
diff options
context:
space:
mode:
authorLarry Wall <lwall@netlabs.com>1991-11-11 03:50:16 +0000
committerLarry Wall <lwall@netlabs.com>1991-11-11 03:50:16 +0000
commit988174c19bcf26f6c6e0551f1dfbba78203bc2ce (patch)
tree7918e82dffc7e46c520ab9fafb727f369b32e8d9 /perl.h
parent55204971972392ce5a252fbbd6d78b1c48ed70e3 (diff)
downloadperl-988174c19bcf26f6c6e0551f1dfbba78203bc2ce.tar.gz
perl 4.0 patch 19: (combined patch)
Ok, here's the cleanup patch I suggested you wait for. Have at it... Subject: added little-endian pack/unpack options This is the only enhancement in this patch, but it seemed unlikely to bust anything else, and added functionality that it was very difficult to do any other way. Compliments of David W. Sanderson. Subject: op/regexp.t failed from missing arg to bcmp() Subject: study was busted by 4.018 Subject: sort $subname was busted by changes in 4.018 Subject: default arg for shift was wrong after first subroutine definition Things that broke in 4.018. Shame on me. Subject: do {$foo ne "bar";} returned wrong value A bug of long standing. How come nobody saw this one? Or if you did, why didn't you report it before now? Or if you did, why did I ignore you? :-) Subject: some machines need -lsocket before -lnsl Subject: some earlier patches weren't propagated to alternate 286 code Subject: compile in the x2p directory couldn't find cppstdin Subject: more hints for aix, isc, hp, sco, uts Subject: installperl no longer updates unchanged library files Subject: uts wrongly defines S_ISDIR() et al Subject: too many preprocessors can't expand a macro right in #if The usual pastiche of portability kludges. Subject: deleted some unused functions from usersub.c And fixed the spelling of John Macdonald's name, and included his suggested workaround for a certain vendor's stdio bug... Subject: added readdir test Subject: made op/groups.t more reliable Subject: added test for sort $subname to op/sort.t Subject: added some hacks to op/stat.t for weird filesystem architectures Improvements (hopefully) to the regression tests.
Diffstat (limited to 'perl.h')
-rw-r--r--perl.h50
1 files changed, 43 insertions, 7 deletions
diff --git a/perl.h b/perl.h
index 09edd0727c..c9064b164f 100644
--- a/perl.h
+++ b/perl.h
@@ -1,4 +1,4 @@
-/* $RCSfile: perl.h,v $$Revision: 4.0.1.4 $$Date: 91/11/05 18:06:10 $
+/* $RCSfile: perl.h,v $$Revision: 4.0.1.5 $$Date: 91/11/11 16:41:07 $
*
* Copyright (c) 1991, Larry Wall
*
@@ -6,6 +6,11 @@
* License or the Artistic License, as specified in the README file.
*
* $Log: perl.h,v $
+ * Revision 4.0.1.5 91/11/11 16:41:07 lwall
+ * patch19: uts wrongly defines S_ISDIR() et al
+ * patch19: too many preprocessors can't expand a macro right in #if
+ * patch19: added little-endian pack/unpack options
+ *
* Revision 4.0.1.4 91/11/05 18:06:10 lwall
* patch11: various portability fixes
* patch11: added support for dbz
@@ -165,6 +170,20 @@ extern int memcmp();
#endif
#include <sys/stat.h>
+#ifdef uts
+#undef S_ISDIR
+#undef S_ISCHR
+#undef S_ISBLK
+#undef S_ISREG
+#undef S_ISFIFO
+#undef S_ISLNK
+#define S_ISDIR(P) (((P)&S_IFMT)==S_IFDIR)
+#define S_ISCHR(P) (((P)&S_IFMT)==S_IFCHR)
+#define S_ISBLK(P) (((P)&S_IFMT)==S_IFBLK)
+#define S_ISREG(P) (((P)&S_IFMT)==S_IFREG)
+#define S_ISFIFO(P) (((P)&S_IFMT)==S_IFIFO)
+#define S_ISLNK(P) (((P)&S_IFMT)==S_IFLNK)
+#endif
#ifdef I_TIME
# include <time.h>
@@ -344,10 +363,6 @@ EXT int dbmlen;
# endif
#endif
-#if S_ISBLK(060000) == 060000
- XXX Your sys/stat.h appears to be buggy. Please fix it.
-#endif
-
#ifndef S_ISREG
# define S_ISREG(m) ((m & S_IFMT) == S_IFREG)
#endif
@@ -426,7 +441,7 @@ EXT int dbmlen;
# define SLOPPYDIVIDE
#endif
-#if defined(cray) || defined(convex) || BYTEORDER > 0xffff
+#if defined(cray) || defined(convex) || defined (uts) || BYTEORDER > 0xffff
# define QUAD
#endif
@@ -434,7 +449,7 @@ EXT int dbmlen;
# ifdef cray
# define quad int
# else
-# ifdef convex
+# if defined(convex) || defined (uts)
# define quad long long
# else
# define quad long
@@ -585,6 +600,27 @@ EXT STR *Str;
#endif
#endif
+/*
+ * Little-endian byte order functions - 'v' for 'VAX', or 'reVerse'.
+ * -DWS
+ */
+#if BYTEORDER != 0x1234
+# define HAS_VTOHL
+# define HAS_VTOHS
+# define HAS_HTOVL
+# define HAS_HTOVS
+# if BYTEORDER == 0x4321
+# define vtohl(x) ((((x)&0xFF)<<24) \
+ +(((x)>>24)&0xFF) \
+ +(((x)&0x0000FF00)<<8) \
+ +(((x)&0x00FF0000)>>8) )
+# define vtohs(x) ((((x)&0xFF)<<8) + (((x)>>8)&0xFF))
+# define htovl(x) vtohl(x)
+# define htovs(x) vtohs(x)
+# endif
+ /* otherwise default to functions in util.c */
+#endif
+
#ifdef CASTNEGFLOAT
#define U_S(what) ((unsigned short)(what))
#define U_I(what) ((unsigned int)(what))