ObjFW  Diff

Differences From Artifact [07290bee4c]:

To Artifact [d3a737b015]:


35
36
37
38
39
40
41
42
43
44
45

46
47
48
49
50
51
52
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_once_t onceControl = OF_ONCE_INIT;
static of_mutex_t mutex;
#endif
static bool initialized = false;
static bool initSuccessful = false;

static void
init(void)
{
#if defined(OF_WINDOWS)
	WSADATA wsa;

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
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

	initialized = true;
	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)
	if (!initialized) {
		init();
		initialized = true;
	}
#endif

	return initialized;
	return initSuccessful;
}

int
of_socket_errno()
{
#ifndef OF_WINDOWS
	return errno;