Browse Source

fixed for newer gcc objective c syntax/compile blah

master
Dan Ballard 10 years ago
parent
commit
92fa074635
  1. 2
      autoTest.pl
  2. 23
      primes.m

2
autoTest.pl

@ -558,7 +558,7 @@ foreach $l (@langs)
# So gcc stoped compiling if teh linking was done before the soruce file was specified
# go figure
$gcc_code = 0;
if ($l =~ /^ca?[23]?$/) {
if ($l =~ /^o?b?j?ca?[23]?$/) {
$gcc_code = 1;
}

23
primes.m

@ -2,16 +2,29 @@
// haplo@mindstab.net
#include <objc/Object.h>
#include <stdio.h>
#include "math.h"
@interface Primes: Object
@interface Primes
{
}
- print:(unsigned int)MAX;
- (void)print:(unsigned int)MAX;
+ (id)alloc;
- (id)init;
@end
@implementation Primes
- print:(unsigned int)MAX
+ (id)alloc
{
return self;
}
- (id)init
{
return self;
}
- (void)print:(unsigned int)MAX
{
unsigned int cnt, test, i;
char isPrime;
@ -48,6 +61,8 @@ int main(int argc, char **argv)
printf("Invalid Max Num\n");
return(1);
}
primes = [Primes alloc];
printf("allocing\n");
primes = [[Primes alloc] init];
printf("calling\n");
[primes print:max];
}

Loading…
Cancel
Save