libmach: move machbyname, mach to crack.c to avoid OS X linker problem

This commit is contained in:
Russ Cox 2007-11-05 14:53:16 -05:00
parent 2640996af8
commit 760f2fb6a9
3 changed files with 26 additions and 31 deletions

View file

@ -4,6 +4,32 @@
#include <mach.h>
#include "elf.h"
Mach *mach;
extern Mach mach386;
extern Mach machpower;
static Mach *machs[] =
{
&mach386,
&machpower,
};
Mach*
machbyname(char *name)
{
int i;
for(i=0; i<nelem(machs); i++)
if(strcmp(machs[i]->name, name) == 0){
mach = machs[i];
return machs[i];
}
werrstr("machine '%s' not found", name);
return nil;
}
static struct
{
ulong magic;