mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-24 11:41:58 +00:00
libmach: move machbyname, mach to crack.c to avoid OS X linker problem
This commit is contained in:
parent
2640996af8
commit
760f2fb6a9
3 changed files with 26 additions and 31 deletions
|
@ -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;
|
||||
|
|
|
@ -1,30 +0,0 @@
|
|||
#include <u.h>
|
||||
#include <libc.h>
|
||||
#include <bio.h>
|
||||
#include <mach.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;
|
||||
}
|
||||
|
|
@ -27,7 +27,6 @@ OFILES=\
|
|||
ieee.$O\
|
||||
loc.$O\
|
||||
localaddr.$O\
|
||||
mach.$O\
|
||||
mach386.$O\
|
||||
macho.$O\
|
||||
machocorepower.$O\
|
||||
|
|
Loading…
Reference in a new issue