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
871dab3e
Commit
871dab3e
authored
Jan 04, 2003
by
Bruce Korb
Committed by
Bruce Korb
Jan 04, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
When wrapping files, guard with both the fix name and the file name
From-SVN: r60893
parent
35d434ed
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
57 additions
and
56 deletions
+57
-56
gcc/ChangeLog
+5
-0
gcc/fixinc/fixfixes.c
+31
-35
gcc/fixinc/tests/base/assert.h
+6
-6
gcc/fixinc/tests/base/math.h
+6
-6
gcc/fixinc/tests/base/stdio.h
+3
-3
gcc/fixinc/tests/base/strings.h
+3
-3
gcc/fixinc/tests/base/sys/mman.h
+3
-3
No files found.
gcc/ChangeLog
View file @
871dab3e
2003
-
01
-
04
Bruce
Korb
<
bkorb
@gnu
.
org
>
*
fixinc
/
fixfixes
.
c
(
wrap_fix
)
:
the
wrapper
guard
must
be
a
function
of
*
both
*
the
file
name
and
the
fix
name
.
2002
-
01
-
04
John
David
Anglin
<
dave
.
anglin
@nrc
.
ca
>
*
config
.
gcc
(
hppa
*
64
*-*-
hpux11
*
)
:
Define
extra_parts
.
Don
'
t
use
...
...
gcc/fixinc/fixfixes.c
View file @
871dab3e
...
...
@@ -597,47 +597,44 @@ FIX_PROC_HEAD( wrap_fix )
tSCC
z_no_wrap_pat
[]
=
"^#if.*__need_"
;
static
regex_t
no_wrapping_re
;
/* assume zeroed data */
char
z_fixname
[
64
];
tCC
*
pz_src
=
p_fixd
->
fix_name
;
tCC
*
pz_name
=
z_fixname
;
char
*
pz_dst
=
z_fixname
;
int
do_end
=
0
;
size_t
len
=
0
;
IGNORE_ARG
(
filname
);
tCC
*
pz_name
=
NULL
;
if
(
no_wrapping_re
.
allocated
==
0
)
compile_re
(
z_no_wrap_pat
,
&
no_wrapping_re
,
0
,
"no-wrap pattern"
,
"wrap-fix"
);
for
(;;)
{
char
ch
=
*
pz_src
++
;
if
(
ch
==
NUL
)
{
*
pz_dst
++
=
ch
;
break
;
}
else
if
(
!
ISALNUM
(
ch
))
{
*
pz_dst
++
=
'_'
;
}
else
{
*
pz_dst
++
=
TOUPPER
(
ch
);
}
if
(
++
len
>=
sizeof
(
z_fixname
))
{
void
*
p
=
xmalloc
(
len
+
strlen
(
pz_src
)
+
1
);
memcpy
(
p
,
(
void
*
)
z_fixname
,
len
);
pz_name
=
(
tCC
*
)
p
;
pz_dst
=
(
char
*
)
pz_name
+
len
;
}
}
/*
* IF we do *not* match the no-wrap re, then we have a double negative.
* A double negative means YES.
*/
if
(
regexec
(
&
no_wrapping_re
,
text
,
0
,
NULL
,
0
)
!=
0
)
if
(
regexec
(
&
no_wrapping_re
,
text
,
0
,
NULL
,
0
)
!=
0
)
{
printf
(
"#ifndef FIXINC_%s_CHECK
\n
"
,
pz_name
);
printf
(
"#define FIXINC_%s_CHECK 1
\n\n
"
,
pz_name
);
do_end
=
1
;
/*
* A single file can get wrapped more than once by different fixes.
* A single fix can wrap multiple files. Therefore, guard with
* *both* the fix name and the file name.
*/
size_t
ln
=
strlen
(
filname
)
+
strlen
(
p_fixd
->
fix_name
)
+
14
;
char
*
pz
=
xmalloc
(
ln
);
pz_name
=
pz
;
sprintf
(
pz
,
"FIXINC_WRAP_%s-%s"
,
filname
,
p_fixd
->
fix_name
);
for
(
pz
+=
12
;
1
;
pz
++
)
{
char
ch
=
*
pz
;
if
(
ch
==
NUL
)
break
;
if
(
!
ISALNUM
(
ch
))
{
*
pz
=
'_'
;
}
else
{
*
pz
=
TOUPPER
(
ch
);
}
}
printf
(
"#ifndef %s
\n
"
,
pz_name
);
printf
(
"#define %s 1
\n\n
"
,
pz_name
);
}
if
(
p_fixd
->
patch_args
[
1
]
==
(
tCC
*
)
NULL
)
...
...
@@ -650,11 +647,10 @@ FIX_PROC_HEAD( wrap_fix )
fputs
(
p_fixd
->
patch_args
[
2
],
stdout
);
}
if
(
do_end
!=
0
)
printf
(
"
\n
#endif /* FIXINC_%s_CHECK */
\n
"
,
pz_name
);
if
(
pz_name
!=
z_fixname
)
if
(
pz_name
!=
NULL
)
{
printf
(
"
\n
#endif /* %s */
\n
"
,
pz_name
);
free
(
(
void
*
)
pz_name
);
}
}
...
...
gcc/fixinc/tests/base/assert.h
View file @
871dab3e
...
...
@@ -7,14 +7,14 @@
This had to be done to correct non-standard usages in the
original, manufacturer supplied header file. */
#ifndef FIXINC_
BROKEN_ASSERT_STDLIB_CHECK
#define FIXINC_
BROKEN_ASSERT_STDLIB_CHECK
1
#ifndef FIXINC_
WRAP_ASSERT_H_BROKEN_ASSERT_STDLIB
#define FIXINC_
WRAP_ASSERT_H_BROKEN_ASSERT_STDLIB
1
#ifdef __cplusplus
#include <stdlib.h>
#endif
#ifndef FIXINC_
BROKEN_ASSERT_STDIO_CHECK
#define FIXINC_
BROKEN_ASSERT_STDIO_CHECK
1
#ifndef FIXINC_
WRAP_ASSERT_H_BROKEN_ASSERT_STDIO
#define FIXINC_
WRAP_ASSERT_H_BROKEN_ASSERT_STDIO
1
#include <stdio.h>
...
...
@@ -38,6 +38,6 @@ extern FILE* stderr;
extern
void
exit
(
int
);
#endif
/* BROKEN_ASSERT_STDLIB_CHECK */
#endif
/* FIXINC_
BROKEN_ASSERT_STDIO_CHECK
*/
#endif
/* FIXINC_
WRAP_ASSERT_H_BROKEN_ASSERT_STDIO
*/
#endif
/* FIXINC_
BROKEN_ASSERT_STDLIB_CHECK
*/
#endif
/* FIXINC_
WRAP_ASSERT_H_BROKEN_ASSERT_STDLIB
*/
gcc/fixinc/tests/base/math.h
View file @
871dab3e
...
...
@@ -7,12 +7,12 @@
This had to be done to correct non-standard usages in the
original, manufacturer supplied header file. */
#ifndef FIXINC_
SUNOS_MATHERR_DECL_CHECK
#define FIXINC_
SUNOS_MATHERR_DECL_CHECK
1
#ifndef FIXINC_
WRAP_MATH_H_SUNOS_MATHERR_DECL
#define FIXINC_
WRAP_MATH_H_SUNOS_MATHERR_DECL
1
struct
exception
;
#ifndef FIXINC_
MATH_EXCEPTION_CHECK
#define FIXINC_
MATH_EXCEPTION_CHECK
1
#ifndef FIXINC_
WRAP_MATH_H_MATH_EXCEPTION
#define FIXINC_
WRAP_MATH_H_MATH_EXCEPTION
1
#ifdef __cplusplus
#define exception __math_exception
...
...
@@ -122,6 +122,6 @@ extern double atof(const char *__nptr);
#undef exception
#endif
#endif
/* FIXINC_
MATH_EXCEPTION_CHECK
*/
#endif
/* FIXINC_
WRAP_MATH_H_MATH_EXCEPTION
*/
#endif
/* FIXINC_
SUNOS_MATHERR_DECL_CHECK
*/
#endif
/* FIXINC_
WRAP_MATH_H_SUNOS_MATHERR_DECL
*/
gcc/fixinc/tests/base/stdio.h
View file @
871dab3e
...
...
@@ -7,8 +7,8 @@
This had to be done to correct non-standard usages in the
original, manufacturer supplied header file. */
#ifndef FIXINC_
STDIO_STDARG_H_CHECK
#define FIXINC_
STDIO_STDARG_H_CHECK
1
#ifndef FIXINC_
WRAP_STDIO_H_STDIO_STDARG_H
#define FIXINC_
WRAP_STDIO_H_STDIO_STDARG_H
1
#define __need___va_list
#include <stdarg.h>
...
...
@@ -80,4 +80,4 @@ extern char *tempnam( const char *, const char *);
void
f
(
char
*
__restrict__
x
);
#endif
/* UNICOSMK_RESTRICT_CHECK */
#endif
/* FIXINC_
STDIO_STDARG_H_CHECK
*/
#endif
/* FIXINC_
WRAP_STDIO_H_STDIO_STDARG_H
*/
gcc/fixinc/tests/base/strings.h
View file @
871dab3e
...
...
@@ -7,8 +7,8 @@
This had to be done to correct non-standard usages in the
original, manufacturer supplied header file. */
#ifndef FIXINC_
ULTRIX_STRINGS_CHECK
#define FIXINC_
ULTRIX_STRINGS_CHECK
1
#ifndef FIXINC_
WRAP_STRINGS_H_ULTRIX_STRINGS
#define FIXINC_
WRAP_STRINGS_H_ULTRIX_STRINGS
1
...
...
@@ -22,4 +22,4 @@
#endif
/* ULTRIX_STRINGS_CHECK */
#endif
/* FIXINC_
ULTRIX_STRINGS_CHECK
*/
#endif
/* FIXINC_
WRAP_STRINGS_H_ULTRIX_STRINGS
*/
gcc/fixinc/tests/base/sys/mman.h
View file @
871dab3e
...
...
@@ -7,8 +7,8 @@
This had to be done to correct non-standard usages in the
original, manufacturer supplied header file. */
#ifndef FIXINC_
CXX_UNREADY_CHECK
#define FIXINC_
CXX_UNREADY_CHECK
1
#ifndef FIXINC_
WRAP_SYS_MMAN_H_CXX_UNREADY
#define FIXINC_
WRAP_SYS_MMAN_H_CXX_UNREADY
1
#ifdef __cplusplus
extern
"C"
{
...
...
@@ -22,4 +22,4 @@ extern void* malloc( size_t );
}
#endif
#endif
/* FIXINC_
CXX_UNREADY_CHECK
*/
#endif
/* FIXINC_
WRAP_SYS_MMAN_H_CXX_UNREADY
*/
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