mirror of
https://github.com/dlang/dmd.git
synced 2025-04-27 05:30:13 +03:00
27 lines
494 B
Objective-C
27 lines
494 B
Objective-C
#import <Foundation/Foundation.h>
|
|
|
|
@interface Foo : NSObject
|
|
{
|
|
// This need to be at least three instance variables of the size of `int`.
|
|
// I'm guessing this is because instance variables start at different
|
|
// offsets in Objective-C and in D.
|
|
@public int a;
|
|
@public int b;
|
|
@public int c;
|
|
}
|
|
@end
|
|
|
|
@implementation Foo
|
|
@end
|
|
|
|
int getInstanceVariableC(Foo* foo)
|
|
{
|
|
return foo->c;
|
|
}
|
|
|
|
void setInstanceVariables(Foo* foo)
|
|
{
|
|
foo->a = 1;
|
|
foo->b = 2;
|
|
foo->c = 3;
|
|
}
|