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
4be7cc98
Commit
4be7cc98
authored
May 06, 1993
by
Richard Stallman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(__objc_send_initialize, class_add_method_list):
Allow multiple +initialize methods per class. From-SVN: r4349
parent
bda63bf1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
9 deletions
+30
-9
gcc/objc/sendmsg.c
+30
-9
No files found.
gcc/objc/sendmsg.c
View file @
4be7cc98
...
@@ -186,14 +186,31 @@ static void __objc_send_initialize(Class* class)
...
@@ -186,14 +186,31 @@ static void __objc_send_initialize(Class* class)
if
(
class
->
super_class
)
if
(
class
->
super_class
)
__objc_send_initialize
(
class
->
super_class
);
__objc_send_initialize
(
class
->
super_class
);
m
=
search_for_method_in_list
(
class
->
class_pointer
->
methods
,
{
sel_get_uid
(
"initialize"
));
MethodList_t
method_list
=
class
->
class_pointer
->
methods
;
if
(
m
!=
NULL
)
SEL
op
=
sel_register_name
(
"initialize"
);
{
CLS_SETINITIALIZED
(
class
);
/* If not found then we'll search the list. */
(
*
m
->
method_imp
)
((
id
)
class
,
sel_get_uid
(
"initialize"
));
while
(
method_list
)
}
{
int
i
;
/* Search the method list. */
for
(
i
=
0
;
i
<
method_list
->
method_count
;
++
i
)
{
Method_t
method
=
&
method_list
->
method_list
[
i
];
if
(
method
->
method_name
==
op
)
(
*
method
->
method_imp
)((
id
)
class
,
op
);
}
/* The method wasn't found. Follow the link to the next list of
methods. */
method_list
=
method_list
->
method_next
;
}
}
}
}
}
}
...
@@ -268,6 +285,9 @@ void
...
@@ -268,6 +285,9 @@ void
class_add_method_list
(
Class
*
class
,
MethodList_t
list
)
class_add_method_list
(
Class
*
class
,
MethodList_t
list
)
{
{
int
i
;
int
i
;
static
SEL
initialize_sel
=
0
;
if
(
!
initialize_sel
)
initialize_sel
=
sel_register_name
(
"initialize"
);
/* Passing of a linked list is not allowed. Do multiple calls. */
/* Passing of a linked list is not allowed. Do multiple calls. */
assert
(
!
list
->
method_next
);
assert
(
!
list
->
method_next
);
...
@@ -282,7 +302,8 @@ class_add_method_list (Class* class, MethodList_t list)
...
@@ -282,7 +302,8 @@ class_add_method_list (Class* class, MethodList_t list)
/* This is where selector names are transmogriffed to SEL's */
/* This is where selector names are transmogriffed to SEL's */
method
->
method_name
=
sel_register_name
((
char
*
)
method
->
method_name
);
method
->
method_name
=
sel_register_name
((
char
*
)
method
->
method_name
);
if
(
search_for_method_in_list
(
class
->
methods
,
method
->
method_name
))
if
(
search_for_method_in_list
(
class
->
methods
,
method
->
method_name
)
&&
method
->
method_name
!=
initialize_sel
)
{
{
/* Duplication. Print a error message an change the method name
/* Duplication. Print a error message an change the method name
to NULL. */
to NULL. */
...
...
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