URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 154 |
Rev 816 |
/* Contributed by Nicola Pero - Fri Mar 9 21:35:47 CET 2001 */
|
/* Contributed by Nicola Pero - Fri Mar 9 21:35:47 CET 2001 */
|
#include <objc/objc.h>
|
#include <objc/objc.h>
|
#include <objc/Protocol.h>
|
#include <objc/Protocol.h>
|
|
|
/* Test defining a protocol, and accessing it using @protocol */
|
/* Test defining a protocol, and accessing it using @protocol */
|
|
|
@protocol Evaluating
|
@protocol Evaluating
|
- (int) importance;
|
- (int) importance;
|
@end
|
@end
|
|
|
/* Without a class adopting the protocol - this doesn't work
|
/* Without a class adopting the protocol - this doesn't work
|
with gcc-2.95.2 as well */
|
with gcc-2.95.2 as well */
|
|
|
int main (void)
|
int main (void)
|
{
|
{
|
Protocol *protocol = @protocol (Evaluating);
|
Protocol *protocol = @protocol (Evaluating);
|
|
|
if (strcmp ([protocol name], "Evaluating"))
|
if (strcmp ([protocol name], "Evaluating"))
|
{
|
{
|
abort ();
|
abort ();
|
}
|
}
|
|
|
return 0;
|
return 0;
|
}
|
}
|
|
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.