Differences From Artifact [8f11763ca5]:
- File src/OFSocket.m — part of check-in [1a86b8175b] at 2022-02-12 07:46:07 on branch trunk — Update copyright (user: js, size: 22416) [annotate] [blame] [check-ins using] [more...]
To Artifact [16116f3ca3]:
- File
src/OFSocket.m
— part of check-in
[a30a0ab261]
at
2022-07-31 13:55:49
on branch nintendo-switch
— Add initial socket code for Nintendo Switch
This doesn't work yet (it crashes on recvfrom), so it's not enabled in
configure for now. (user: js, size: 22537) [annotate] [blame] [check-ins using] [more...]
| ︙ | ︙ | |||
52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# include <proto/exec.h>
#endif
#ifdef OF_NINTENDO_3DS
# include <3ds/types.h>
# include <3ds/services/soc.h>
#endif
#if defined(OF_HAVE_THREADS) && (!defined(OF_AMIGAOS) || defined(OF_MORPHOS))
static OFMutex *mutex;
static void
releaseMutex(void)
{
| > > > > > > | 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# include <proto/exec.h>
#endif
#ifdef OF_NINTENDO_3DS
# include <3ds/types.h>
# include <3ds/services/soc.h>
#endif
#ifdef OF_NINTENDO_SWITCH
# define id nx_id
# include <switch.h>
# undef id
#endif
#if defined(OF_HAVE_THREADS) && (!defined(OF_AMIGAOS) || defined(OF_MORPHOS))
static OFMutex *mutex;
static void
releaseMutex(void)
{
|
| ︙ | ︙ | |||
126 127 128 129 130 131 132 133 134 135 136 137 | if ((ctx = memalign(0x1000, 0x100000)) == NULL) return; if (socInit(ctx, 0x100000) != 0) return; atexit((void (*)(void))socExit); # endif # if defined(OF_HAVE_THREADS) && (!defined(OF_AMIGAOS) || defined(OF_MORPHOS)) mutex = [[OFMutex alloc] init]; atexit(releaseMutex); | > > > > > < < < < < | 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 |
if ((ctx = memalign(0x1000, 0x100000)) == NULL)
return;
if (socInit(ctx, 0x100000) != 0)
return;
atexit((void (*)(void))socExit);
# elif defined(OF_NINTENDO_SWITCH)
if (R_FAILED(socketInitializeDefault()))
return;
atexit(socketExit);
# endif
# if defined(OF_HAVE_THREADS) && (!defined(OF_AMIGAOS) || defined(OF_MORPHOS))
mutex = [[OFMutex alloc] init];
atexit(releaseMutex);
# endif
initSuccessful = true;
}
OF_DESTRUCTOR()
{
|
| ︙ | ︙ |