Skip to content

Commit

Permalink
Merge pull request #432 from Wolf3s/ps2_update
Browse files Browse the repository at this point in the history
Fix ps2 warnings and remove read macros
  • Loading branch information
sahlberg authored Oct 31, 2023
2 parents 8ce860a + 2fb84e3 commit ea3b815
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
13 changes: 8 additions & 5 deletions lib/socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -816,16 +816,19 @@ rpc_connect_sockaddr_async(struct rpc_context *rpc)
*/
{
struct sockaddr_storage ss;
struct sockaddr_in *sin;
struct sockaddr_in6 *sin6;
struct sockaddr_in *sin;
#if !defined(PS3_PPU) && !defined(PS2_EE)
struct sockaddr_in6 *sin6;
#endif
static int portOfs = 0;
const int firstPort = 512; /* >= 512 according to Sun docs */
const int portCount = IPPORT_RESERVED - firstPort;
int startOfs, port, rc;

sin = (struct sockaddr_in *)&ss;
sin6 = (struct sockaddr_in6 *)&ss;

sin = (struct sockaddr_in *)&ss;
#if !defined(PS3_PPU) && !defined(PS2_EE)
sin6 = (struct sockaddr_in6 *)&ss;
#endif
if (portOfs == 0) {
portOfs = rpc_current_time() % 400;
}
Expand Down
5 changes: 2 additions & 3 deletions ps2_ee/ps2_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,14 @@
#include <sys/time.h>
#include <sys/utime.h>
#include <ps2ip.h>
#include <unistd.h>

typedef unsigned long int fsfilcnt_t;

#define getservbyport(a,b) NULL
#define major(a) 0
#define minor(a) 0
#define O_NOFOLLOW 0
#define X_OK 1
#define W_OK 2
#define R_OK 4

struct statvfs {
unsigned long int f_bsize;
Expand All @@ -59,6 +57,7 @@ struct statvfs {

#define write(a,b,c) lwip_write(a,b,c)
#define read(a,b,c) lwip_read(a,b,c)
#undef gethostbyname /* PS2SDK has gethostbyname defined */
#define gethostbyname(a) lwip_gethostbyname(a)
#define close(a) lwip_close(a)

Expand Down

0 comments on commit ea3b815

Please sign in to comment.