Skip to content

Commit

Permalink
hosted/gdb_if: Added proper handling for formatting socket_t's on win…
Browse files Browse the repository at this point in the history
…dows vs everything else
  • Loading branch information
dragonmux committed Jul 18, 2023
1 parent c29acb4 commit 2b0a074
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/platforms/hosted/gdb_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <winsock2.h>

typedef SOCKET socket_t;
#define PRI_SOCKET "zu"
#ifndef __CYGWIN__
typedef signed long long ssize_t;
#endif
Expand All @@ -46,6 +47,7 @@ typedef signed long long ssize_t;
#include <fcntl.h>

typedef int32_t socket_t;
#define PRI_SOCKET "d"
#define INVALID_SOCKET (-1)
#endif

Expand Down Expand Up @@ -170,7 +172,7 @@ static void display_socket_error(const int error, const socket_t socket, const c
#else
const char *message = strerror(error);
#endif
DEBUG_ERROR("Error %s %d, got error %d: %s\n", operation, socket, error, message);
DEBUG_ERROR("Error %s %" PRI_SOCKET ", got error %d: %s\n", operation, socket, error, message);
#if defined(_WIN32) || defined(__CYGWIN__)
LocalFree(message);
#endif
Expand Down

0 comments on commit 2b0a074

Please sign in to comment.