Convert more to C++

This commit is contained in:
BullyWiiPlaza 2017-09-28 22:14:32 +02:00
parent b59ef61113
commit 83751fdd75
5 changed files with 15 additions and 9 deletions

View File

@ -4,13 +4,11 @@
#include "../common/types.h" #include "../common/types.h"
#include "../dynamic_libs/os_functions.h" #include "../dynamic_libs/os_functions.h"
/* Main */
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
//! C wrapper for our C++ functions int Menu_Main();
int Menu_Main(void);
extern bool isCodeHandlerInstalled; extern bool isCodeHandlerInstalled;
extern bool areSDCheatsEnabled; extern bool areSDCheatsEnabled;

View File

@ -156,7 +156,7 @@ int cafiine_send_handle(int sock, const char *path, int handle) {
return -1; return -1;
} }
int cafiine_fopen(int sock, int *result, const char *path, const char *mode, int *handle) { /*int cafiine_fopen(int sock, int *result, const char *path, const char *mode, int *handle) {
while (iLock) while (iLock)
usleep(5000); usleep(5000);
iLock = 1; iLock = 1;
@ -201,7 +201,7 @@ int cafiine_fopen(int sock, int *result, const char *path, const char *mode, int
error: error:
iLock = 0; iLock = 0;
return final_result; return final_result;
} }*/
void cafiine_send_file(int sock, char *file, int size, int fd) { void cafiine_send_file(int sock, char *file, int size, int fd) {
while (iLock) while (iLock)
@ -481,7 +481,7 @@ int recvwait(int sock, void *buffer, int len) {
ret = recv(sock, buffer, len, 0); ret = recv(sock, buffer, len, 0);
CHECK_ERROR(ret < 0); CHECK_ERROR(ret < 0);
len -= ret; len -= ret;
buffer += ret; buffer = &buffer + ret;
} }
return 0; return 0;
error: error:
@ -494,7 +494,7 @@ int recvwaitlen(int sock, void *buffer, int len) {
ret = recv(sock, buffer, len, 0); ret = recv(sock, buffer, len, 0);
CHECK_ERROR(ret < 0); CHECK_ERROR(ret < 0);
len -= ret; len -= ret;
buffer += ret; buffer = &buffer + ret;
} }
return 0; return 0;
error: error:
@ -517,7 +517,7 @@ int sendwait(int sock, const void *buffer, int len) {
ret = send(sock, buffer, len, 0); ret = send(sock, buffer, len, 0);
CHECK_ERROR(ret < 0); CHECK_ERROR(ret < 0);
len -= ret; len -= ret;
buffer += ret; buffer = &buffer + ret;
} }
return 0; return 0;
error: error:

View File

@ -6,6 +6,14 @@
#define TITLE_ID_BAYONETTA_2 0x0005000010172500 #define TITLE_ID_BAYONETTA_2 0x0005000010172500
#define TITLE_ID_INTERNET_BROWSER 0x000500301001200A #define TITLE_ID_INTERNET_BROWSER 0x000500301001200A
#ifdef __cplusplus
extern "C" {
#endif
bool isRunningAllowedTitleID(); bool isRunningAllowedTitleID();
#ifdef __cplusplus
}
#endif
#endif #endif

Binary file not shown.