Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
riscv-gcc-1
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
riscv-gcc-1
Commits
5a157bc4
Commit
5a157bc4
authored
Mar 17, 1994
by
Ian Lance Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Define BYTE_ORDER in <sys/byteorder.h> as on UnixWare 1.1
From-SVN: r6804
parent
e2a77f99
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
0 deletions
+40
-0
gcc/fixinc.svr4
+40
-0
No files found.
gcc/fixinc.svr4
View file @
5a157bc4
...
...
@@ -1375,6 +1375,9 @@ fi
cd
${
ORIG_DIR
}
echo
'Replacing <sys/byteorder.h>'
if
[
\!
-d
$LIB
/sys
]
;
then
mkdir
$LIB
/sys
fi
rm
-f
${
LIB
}
/sys/byteorder.h
cat
<<
'
__EOF__
' >
${
LIB
}
/sys/byteorder.h
#ifndef _SYS_BYTEORDER_H
...
...
@@ -1396,6 +1399,14 @@ cat <<'__EOF__' >${LIB}/sys/byteorder.h
#error You lose! This file is only useful with GNU compilers.
#endif
#ifndef __BYTE_ORDER__
/* Byte order defines. These are as defined on UnixWare 1.1, but with
double underscores added at the front and back. */
#define __LITTLE_ENDIAN__ 1234
#define __BIG_ENDIAN__ 4321
#define __PDP_ENDIAN__ 3412
#endif
#ifdef __GNUC__
#define __STATIC static
#else
...
...
@@ -1411,6 +1422,10 @@ __STATIC __inline__ unsigned short ntohs (unsigned int);
#if defined (__i386__)
#ifndef __BYTE_ORDER__
#define __BYTE_ORDER__ __LITTLE_ENDIAN__
#endif
/* Convert a host long to a network long. */
/* We must use a new-style function definition, so that this will also
...
...
@@ -1441,6 +1456,10 @@ htons (unsigned int __arg)
|| defined (__ns32k__) || defined (__vax__) \
|| defined (__spur__) || defined (__arm__))
#ifndef __BYTE_ORDER__
#define __BYTE_ORDER__ __LITTLE_ENDIAN__
#endif
/* For other little-endian machines, using C code is just as efficient as
using assembly code. */
...
...
@@ -1472,6 +1491,10 @@ htons (unsigned int __arg)
#else /* must be a big-endian machine */
#ifndef __BYTE_ORDER__
#define __BYTE_ORDER__ __BIG_ENDIAN__
#endif
/* Convert a host long to a network long. */
__STATIC __inline__ unsigned long
...
...
@@ -1509,6 +1532,23 @@ ntohs (unsigned int __arg)
#undef __STATIC
__EOF__
if
[
-r
${
INPUT
}
/sys/byteorder.h
]
;
then
if
grep
BYTE_ORDER
${
INPUT
}
/sys/byteorder.h
>
/dev/null 2>/dev/null
;
then
cat
<<
'
__EOF__
' >>
${
LIB
}
/sys/byteorder.h
#ifndef BYTE_ORDER
#define LITTLE_ENDIAN __LITTLE_ENDIAN__
#define BIG_ENDIAN __BIG_ENDIAN__
#define PDP_ENDIAN __PDP_ENDIAN__
#define BYTE_ORDER __BYTE_ORDER__
#endif
__EOF__
fi
fi
cat
<<
'
__EOF__
' >>
${
LIB
}
/sys/byteorder.h
#endif /* !defined (_SYS_BYTEORDER_H) */
__EOF__
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment