Make it easier to compile on Mac OS X.

This commit is contained in:
Tadashi G. Takaoka 2010-05-12 10:13:39 +12:00 committed by Daniel Beer
parent 5b943536e4
commit 961e7015c9
2 changed files with 8 additions and 0 deletions

View File

@ -19,10 +19,16 @@
#include <stdlib.h> #include <stdlib.h>
#include <errno.h> #include <errno.h>
#include <string.h> #include <string.h>
#ifdef __APPLE__
#include <libelf.h>
#else
#include <elf.h> #include <elf.h>
#endif
#include "binfile.h" #include "binfile.h"
#ifndef EM_MSP430
#define EM_MSP430 0x69 #define EM_MSP430 0x69
#endif
static const u_int8_t elf32_id[] = { static const u_int8_t elf32_id[] = {
ELFMAG0, ELFMAG1, ELFMAG2, ELFMAG3, ELFCLASS32 ELFMAG0, ELFMAG1, ELFMAG2, ELFMAG3, ELFCLASS32

View File

@ -65,9 +65,11 @@ static int open_interface(struct rf2500_transport *tr,
return -1; return -1;
} }
#ifndef __APPLE__
if (usb_detach_kernel_driver_np(tr->handle, tr->int_number) < 0) if (usb_detach_kernel_driver_np(tr->handle, tr->int_number) < 0)
perror("rf2500: warning: can't " perror("rf2500: warning: can't "
"detach kernel driver"); "detach kernel driver");
#endif
if (usb_claim_interface(tr->handle, tr->int_number) < 0) { if (usb_claim_interface(tr->handle, tr->int_number) < 0) {
perror("rf2500: can't claim interface"); perror("rf2500: can't claim interface");