Skip to content

Commit

Permalink
Fix up dreamcast specific issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Heel committed Nov 13, 2023
1 parent ef5e14c commit 6623c1c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
17 changes: 14 additions & 3 deletions lib/Makefile.DC_KOS
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
KOS_CFLAGS = -DDC_KOS_PLATFORM -DNEED_BE64TOH -DHAVE_STDINT_H -DHAVE_STRING_H \
-DHAVE_STDLIB_H -DHAVE_SYS_TYPES_H -DHAVE_UNISTD_H -DHAVE_SYS_STAT_H -DHAVE_TIME_H \
-DHAVE_SYS_SOCKET_H \
KOS_CFLAGS = -DDC_KOS_PLATFORM -DNEED_WRITEV -DNEED_READV -DHAVE_STDINT_H -DHAVE_STRING_H \
-DHAVE_SYS_TYPES_H -DHAVE_UNISTD_H -DHAVE_SYS_STAT_H -DHAVE_TIME_H -DHAVE_NETINET_IN_H \
-DHAVE_SYS_SOCKET_H -D HAVE_NETDB_H -DHAVE_POLL_H -DHAVE_STDLIB_H \
-D_U_=/**/ -I../include -I../include/smb2 $(KOS_INC_PATHS)

TARGET = libsmb2.a
Expand Down Expand Up @@ -53,5 +53,16 @@ OBJS = aes128ccm.o \
socket.o \
sync.o

install: defaultall
ifeq ($(KOS_BASE),)
@echo "$KOS_BASE is not set. Can not install libsmb2."
@exit 1
endif
@echo Copying...
@[ -d $(KOS_BASE)/addons/include/smb2 ] || mkdir -p $(KOS_BASE)/addons/include/smb2
@cp -frv ../include/smb2/*.h $(KOS_BASE)/addons/include/smb2
@chmod 0644 $(TARGET)
@cp -frv $(TARGET) $(KOS_BASE)/addons/lib/dreamcast
@echo Done!

include ${KOS_PORTS}/scripts/lib.mk
4 changes: 3 additions & 1 deletion lib/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,10 @@ long long int be64toh(long long int x);

#include <netdb.h>
#include <netinet/in.h>
#include <poll.h>
#include <stdlib.h>
#include <string.h>
#include <sys/errno.h>
#include <unistd.h>

#define getlogin_r(a,b) ENXIO

Expand Down
3 changes: 2 additions & 1 deletion lib/sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ static int wait_for_reply(struct smb2_context *smb2,
time_t t = time(NULL);

while (!cb_data->is_finished) {
struct pollfd pfd;
struct pollfd pfd;
memset(&pfd, 0, sizeof(struct pollfd));

pfd.fd = smb2_get_fd(smb2);
pfd.events = smb2_which_events(smb2);
Expand Down

0 comments on commit 6623c1c

Please sign in to comment.