add macos support

This commit is contained in:
Hanabi 2021-11-28 23:26:50 +08:00 committed by jiang jianjun
parent 0be806ed14
commit 3993561f5e
2 changed files with 4 additions and 2 deletions

View File

@ -53,7 +53,7 @@ all : $(NAME)
$(NAME) : $(OBJS)
@echo [LD] Linking $@
@$(CC) $(LDFLAGS) $(LIBDIRS) -Wl,--cref,-Map=$@.map $^ -o $@ $(LIBS)
@$(CC) $(LDFLAGS) $(LIBDIRS) -Wl $^ -o $@ $(LIBS)
$(SOBJS) : %.o : %.S
@echo [AS] $<
@ -73,4 +73,4 @@ install:
install -Dm0644 LICENSE /usr/share/licenses/xfel/LICENSE
clean:
@$(RM) $(DEPS) $(OBJS) $(NAME).map $(NAME).exe $(NAME) *~
@$(RM) $(DEPS) $(OBJS) $(NAME).exe $(NAME) *~

2
x.h
View File

@ -10,6 +10,8 @@ extern "C" {
#endif
#if defined(__linux__) || defined(__CYGWIN__)
# include <endian.h>
#elif defined(__MACH__)
# include <sys/types.h>
#elif defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__)
# include <sys/endian.h>
#elif defined(__WINDOWS__)