Skip to content

Commit

Permalink
Fix AMIGA_OS Warnings
Browse files Browse the repository at this point in the history
Change __PS2SDK_IOP__ to __ps2sdk__
  • Loading branch information
Wolf3s committed Jun 8, 2024
1 parent 6a0c8c0 commit 4051b0b
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 16 deletions.
2 changes: 1 addition & 1 deletion include/asprintf.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#ifndef _ASPRINTF_H_
#define _ASPRINTF_H_

#if !defined(__AROS__) && !defined(__PS2SDK_IOP__)
#if !defined(__AROS__) && !defined(__ps2sdk__)
#include <malloc.h>
#endif
#include <stdio.h>
Expand Down
2 changes: 1 addition & 1 deletion lib/Makefile.AMIGA
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ STRIP = ppc-amigaos-strip

OPTIMIZE = -O2
DEBUG = -gstabs
WARNINGS = -Wall -Wno-pointer-sign -Wno-discarded-qualifiers -Wwrite-strings -Werror
WARNINGS = -Wall -Werror -Wwrite-strings
INCLUDES = -I. -I../include -I../include/smb2 -I../include/amiga_os
DEFINES = -DHAVE_CONFIG_H "-D_U_=__attribute__((unused))" -DNEED_POLL -DNEED_GETADDRINFO -DNEED_FREEADDRINFO -DNEED_GETLOGIN_R -DHAVE_LINGER

Expand Down
21 changes: 9 additions & 12 deletions lib/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ struct sockaddr_storage {
#ifdef _EE
#include <unistd.h>
#else
#ifndef __PS2SDK_IOP__
#ifndef __ps2sdk__
#include <alloc.h>
#endif
#include <stdint.h>
Expand All @@ -452,14 +452,6 @@ long long int be64toh(long long int x);
#ifdef _IOP
char *strdup(const char *s);

#ifdef __PS2SDK_IOP__
void *malloc(int size);

void free(void *ptr);

void *calloc(size_t nmemb, size_t size);
#endif

int random(void);
void srandom(unsigned int seed);
time_t time(time_t *tloc);
Expand All @@ -469,9 +461,6 @@ int getlogin_r(char *buf, size_t size);

#ifdef _IOP
int getpid();
#endif

#ifdef _IOP
#define close(x) lwip_close(x)
#define snprintf(format, n, ...) sprintf(format, __VA_ARGS__)
#define fcntl(a,b,c) lwip_fcntl(a,b,c)
Expand Down Expand Up @@ -519,6 +508,14 @@ int iop_connect(int sockfd, struct sockaddr *addr, socklen_t addrlen);
#define read(a,b,c) lwip_recv(a,b,c,MSG_DONTWAIT)
#endif

#ifdef __ps2sdk__
void *malloc(int size);

void free(void *ptr);

void *calloc(size_t nmemb, size_t size);
#endif

ssize_t writev(t_socket fd, const struct iovec *iov, int iovcnt);
ssize_t readv(t_socket fd, const struct iovec *iov, int iovcnt);

Expand Down
2 changes: 1 addition & 1 deletion lib/libsmb2.c
Original file line number Diff line number Diff line change
Expand Up @@ -2398,7 +2398,7 @@ readlink_cb_3(struct smb2_context *smb2, int status,
{
struct readlink_cb_data *cb_data = private_data;
struct smb2_reparse_data_buffer *rp = cb_data->reparse;
char *target = "<unknown reparse point type>";
char *target = (char*)"<unknown reparse point type>";

if (rp) {
switch (rp->reparse_tag) {
Expand Down
2 changes: 1 addition & 1 deletion lib/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@ smb2_connect_async(struct smb2_context *smb2, const char *server,
if (port != NULL) {
*port++ = 0;
} else {
port = "445";
port = (char*)"445";
}

/* is it a hostname ? */
Expand Down

0 comments on commit 4051b0b

Please sign in to comment.