Compile with latest wut, compile with WUPS 0.5

This commit is contained in:
Maschell 2021-04-17 14:20:41 +02:00
parent 71ee86025f
commit dd28076063
7 changed files with 25 additions and 58 deletions

View File

@ -1,6 +1,6 @@
FROM wiiuenv/devkitppc:20210101 FROM wiiuenv/devkitppc:20210414
COPY --from=wiiuenv/wiiupluginsystem:20210316 /artifacts $DEVKITPRO COPY --from=wiiuenv/wiiupluginsystem:20210417 /artifacts $DEVKITPRO
COPY --from=wiiuenv/libiosuhax:20210109 /artifacts $DEVKITPRO COPY --from=wiiuenv/libiosuhax:20210109 /artifacts $DEVKITPRO
WORKDIR project WORKDIR project

View File

@ -23,19 +23,19 @@ misrepresented as being the original software.
3.This notice may not be removed or altered from any source distribution. 3.This notice may not be removed or altered from any source distribution.
*/ */
#include <errno.h>
#include <malloc.h> #include <malloc.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <sys/dir.h> #include <sys/dir.h>
#include <coreinit/thread.h> #include <coreinit/thread.h>
#include <unistd.h> #include <unistd.h>
#include <nsysnet/socket.h> #include <errno.h>
#include "main.h" #include "main.h"
#include "utils/logger.h" #include "utils/logger.h"
//! TODO: fix those function //! TODO: fix those function
#define gettime() OSGetTick() #define gettime() OSGetTick()
#define errno wiiu_geterrno()
#include "ftp.h" #include "ftp.h"
#include "virtualpath.h" #include "virtualpath.h"
@ -746,7 +746,7 @@ static bool process_accept_events(int32_t server) {
int32_t peer; int32_t peer;
struct sockaddr_in client_address; struct sockaddr_in client_address;
int32_t addrlen = sizeof(client_address); int32_t addrlen = sizeof(client_address);
while ((peer = network_accept(server, (struct sockaddr *)&client_address, &addrlen)) != -WIIU_EAGAIN) { while ((peer = network_accept(server, (struct sockaddr *)&client_address, &addrlen)) != -EAGAIN) {
if (peer < 0) { if (peer < 0) {
console_printf("Error accepting connection: [%i] %s\n", -peer, strerror(-peer)); console_printf("Error accepting connection: [%i] %s\n", -peer, strerror(-peer));
return false; return false;
@ -813,8 +813,8 @@ static void process_data_events(client_t *client) {
} else { } else {
if ((result = network_connect(client->data_socket, (struct sockaddr *)&client->address, sizeof(client->address))) < 0) { if ((result = network_connect(client->data_socket, (struct sockaddr *)&client->address, sizeof(client->address))) < 0) {
if (result == -EINPROGRESS || result == -EALREADY) if (result == -EINPROGRESS || result == -EALREADY)
result = -WIIU_EAGAIN; result = -EAGAIN;
if ((result != -WIIU_EAGAIN) && (result != -EISCONN)) { if ((result != -EAGAIN) && (result != -EISCONN)) {
console_printf("Unable to connect to client: [%i] %s\n", -result, strerror(-result)); console_printf("Unable to connect to client: [%i] %s\n", -result, strerror(-result));
} }
} }
@ -833,7 +833,7 @@ static void process_data_events(client_t *client) {
result = client->data_callback(client->data_socket, client->data_connection_callback_arg); result = client->data_callback(client->data_socket, client->data_connection_callback_arg);
} }
if (result <= 0 && result != -WIIU_EAGAIN) { if (result <= 0 && result != -EAGAIN) {
cleanup_data_resources(client); cleanup_data_resources(client);
if (result < 0) { if (result < 0) {
result = write_reply(client, 520, "Closing data connection, error occurred during transfer."); result = write_reply(client, 520, "Closing data connection, error occurred during transfer.");

View File

@ -1,34 +1,14 @@
#include <wups.h> #include <wups.h>
#include <string.h> #include <cstring>
#include <stdarg.h>
#include <stdlib.h>
#include <malloc.h>
#include <stdint.h>
#include <iosuhax.h> #include <iosuhax.h>
#include <iosuhax_devoptab.h> #include <iosuhax_devoptab.h>
#include <iosuhax_disc_interface.h> #include <iosuhax_disc_interface.h>
#include <proc_ui/procui.h>
#include <coreinit/foreground.h>
#include <coreinit/screen.h>
#include <sysapp/launch.h>
#include <coreinit/dynload.h> #include <coreinit/dynload.h>
#include <nn/ac.h> #include <nn/ac.h>
#include <stdarg.h>
#include <whb/proc.h>
#include <stdlib.h>
#include <coreinit/thread.h>
#include <coreinit/cache.h> #include <coreinit/cache.h>
#include <coreinit/time.h>
#include <stdio.h>
#include <whb/libmanager.h>
#include "utils/logger.h" #include "utils/logger.h"
#include "utils/utils.h"
#include <whb/log_udp.h> #include <whb/log_udp.h>
#include "virtualpath.h" #include "virtualpath.h"
#include "net.h"
#include "BackgroundThread.hpp" #include "BackgroundThread.hpp"
#define MAX_CONSOLE_LINES_TV 27 #define MAX_CONSOLE_LINES_TV 27
@ -46,22 +26,12 @@ uint32_t hostIpAddress = 0;
int iosuhaxMount = 0; int iosuhaxMount = 0;
int fsaFd = -1; int fsaFd = -1;
BackgroundThread * thread = NULL; BackgroundThread * thread = nullptr;
/* Entry point */ /* Entry point */
ON_APPLICATION_START() { ON_APPLICATION_START() {
WHBInitializeSocketLibrary();
nn::ac::ConfigIdNum configId;
nn::ac::Initialize();
nn::ac::GetStartupId(&configId);
nn::ac::Connect(configId);
ACGetAssignedAddress(&hostIpAddress); ACGetAssignedAddress(&hostIpAddress);
nn::ac::Finalize();
WHBLogUdpInit(); WHBLogUdpInit();
//!******************************************************************* //!*******************************************************************

View File

@ -6,21 +6,11 @@
extern "C" { extern "C" {
#endif #endif
#include <stdint.h> #include <stdint.h>
#include <nsysnet/socket.h> #include "net.h"
#define MAXPATHLEN 256 #define MAXPATHLEN 256
#define WIIU_EAGAIN EWOULDBLOCK #define wiiu_geterrno() (errno)
#define ENODATA 1
#define EISCONN 3
#define EWOULDBLOCK 6
#define EALREADY 10
#define EAGAIN EWOULDBLOCK
#define EINVAL 11
#define ENOMEM 18
#define EINPROGRESS 22
#define wiiu_geterrno() (socketlasterr())
//! C wrapper for our C++ functions //! C wrapper for our C++ functions
int Menu_Main(void); int Menu_Main(void);

View File

@ -27,7 +27,6 @@ misrepresented as being the original software.
#include <malloc.h> #include <malloc.h>
#include <unistd.h> #include <unistd.h>
#include <sys/fcntl.h> #include <sys/fcntl.h>
#include <nsysnet/socket.h>
#include "main.h" #include "main.h"
#define MIN(x, y) ((x) < (y) ? (x) : (y)) #define MIN(x, y) ((x) < (y) ? (x) : (y))
@ -48,7 +47,7 @@ void initialise_network() {
int32_t result = -1; int32_t result = -1;
while (!check_reset_synchronous() && result < 0) { while (!check_reset_synchronous() && result < 0) {
net_deinit(); net_deinit();
while (!check_reset_synchronous() && (result = net_init()) == -WIIU_EAGAIN); while (!check_reset_synchronous() && (result = net_init()) == -EAGAIN);
if (result < 0) if (result < 0)
printf("net_init() failed: [%i] %s, retrying...\n", result, strerror(-result)); printf("net_init() failed: [%i] %s, retrying...\n", result, strerror(-result));
} }
@ -148,7 +147,7 @@ int32_t network_close(int32_t s) {
if(s < 0) if(s < 0)
return -1; return -1;
return socketclose(s); return close(s);
} }
int32_t set_blocking(int32_t s, bool blocking) { int32_t set_blocking(int32_t s, bool blocking) {
@ -245,7 +244,7 @@ int32_t send_from_file(int32_t s, FILE *f) {
goto end; goto end;
} }
free(buf); free(buf);
return -WIIU_EAGAIN; return -EAGAIN;
end: end:
free(buf); free(buf);
return result; return result;

View File

@ -28,8 +28,16 @@ misrepresented as being the original software.
extern "C"{ extern "C"{
#endif #endif
#include <stdio.h> #include <stdint.h>
#include <stdbool.h> #include <stdbool.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <unistd.h>
#include <errno.h>
#include <stdio.h>
#if 0 #if 0
void initialise_network(); void initialise_network();

View File

@ -22,7 +22,7 @@ misrepresented as being the original software.
3.This notice may not be removed or altered from any source distribution. 3.This notice may not be removed or altered from any source distribution.
*/ */
#include <errno.h>
#include <malloc.h> #include <malloc.h>
#include <stdarg.h> #include <stdarg.h>
#include <string.h> #include <string.h>