Differences From Artifact [07290bee4c]:
- File src/socket.m — part of check-in [7e5c81e186] at 2018-01-03 19:49:46 on branch trunk — Update copyright notice (user: js, size: 4109) [annotate] [blame] [check-ins using]
To Artifact [d3a737b015]:
- File
src/socket.m
— part of check-in
[885d84a1a7]
at
2018-03-18 01:01:42
on branch trunk
— socket.m: Minor cleanup
This should make the init behavior the same for --enable-threads and
--disable-threads. (user: js, size: 4180) [annotate] [blame] [check-ins using]
| ︙ | ︙ | |||
35 36 37 38 39 40 41 | #ifdef OF_NINTENDO_3DS # include <3ds/types.h> # include <3ds/services/soc.h> #endif #ifdef OF_HAVE_THREADS | < | | 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
#ifdef OF_NINTENDO_3DS
# include <3ds/types.h>
# include <3ds/services/soc.h>
#endif
#ifdef OF_HAVE_THREADS
static of_mutex_t mutex;
#endif
static bool initSuccessful = false;
static void
init(void)
{
#if defined(OF_WINDOWS)
WSADATA wsa;
|
| ︙ | ︙ | |||
73 74 75 76 77 78 79 | # ifdef OF_WII if (!of_spinlock_new(&spinlock)) return; # endif #endif | | > > | > > | | 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 |
# ifdef OF_WII
if (!of_spinlock_new(&spinlock))
return;
# endif
#endif
initSuccessful = true;
}
bool
of_socket_init()
{
#ifdef OF_HAVE_THREADS
static of_once_t onceControl = OF_ONCE_INIT;
of_once(&onceControl, init);
#else
static bool initialized = false;
if (!initialized) {
init();
initialized = true;
}
#endif
return initSuccessful;
}
int
of_socket_errno()
{
#ifndef OF_WINDOWS
return errno;
|
| ︙ | ︙ |