Skip to content

Commit be5c7b7

Browse files
committed
Try 1 to fix the mac build
1 parent b21f520 commit be5c7b7

File tree

7 files changed

+21
-28
lines changed

7 files changed

+21
-28
lines changed

include/mgclient.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -137,17 +137,17 @@ extern "C" {
137137
/// Client software version.
138138
///
139139
/// \return Client version in the major.minor.patch format.
140-
MGCLIENT_EXPORT const char *mg_client_version();
140+
MGCLIENT_EXPORT const char *mg_client_version(void);
141141

142142
/// Initializes the client (the whole process).
143143
/// Should be called at the beginning of each process using the client.
144144
///
145145
/// \return Zero if initialization was successful.
146-
MGCLIENT_EXPORT int mg_init();
146+
MGCLIENT_EXPORT int mg_init(void);
147147

148148
/// Finalizes the client (the whole process).
149149
/// Should be called at the end of each process using the client.
150-
MGCLIENT_EXPORT void mg_finalize();
150+
MGCLIENT_EXPORT void mg_finalize(void);
151151

152152
/// An enum listing all the types as specified by Bolt protocol.
153153
enum mg_value_type {
@@ -297,7 +297,7 @@ typedef struct mg_point_3d mg_point_3d;
297297
/// Constructs a nil \ref mg_value.
298298
///
299299
/// \return Pointer to the newly constructed value or NULL if error occurred.
300-
MGCLIENT_EXPORT mg_value *mg_value_make_null();
300+
MGCLIENT_EXPORT mg_value *mg_value_make_null(void);
301301

302302
/// Constructs a boolean \ref mg_value.
303303
///
@@ -1221,7 +1221,7 @@ typedef int (*mg_trust_callback_type)(const char *, const char *, const char *,
12211221
const char *, void *);
12221222

12231223
/// Creates a new `mg_session_params` object.
1224-
MGCLIENT_EXPORT mg_session_params *mg_session_params_make();
1224+
MGCLIENT_EXPORT mg_session_params *mg_session_params_make(void);
12251225

12261226
/// Destroys a `mg_session_params` object.
12271227
MGCLIENT_EXPORT void mg_session_params_destroy(mg_session_params *);

src/apple/mgsocket.c

+3-5
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616

1717
#include <string.h>
1818

19-
#include "mgcommon.h"
20-
2119
#define MG_RETRY_ON_EINTR(expression) \
2220
__extension__({ \
2321
long result; \
@@ -27,7 +25,7 @@
2725
result; \
2826
})
2927

30-
int mg_socket_init() { return MG_SUCCESS; }
28+
int mg_socket_init(void) { return MG_SUCCESS; }
3129

3230
int mg_socket_create(int af, int type, int protocol) {
3331
int sockfd = socket(af, type, protocol);
@@ -92,6 +90,6 @@ int mg_socket_pair(int d, int type, int protocol, int *sv) {
9290

9391
int mg_socket_close(int sock) { return MG_RETRY_ON_EINTR(close(sock)); }
9492

95-
char *mg_socket_error() { return strerror(errno); }
93+
char *mg_socket_error(void) { return strerror(errno); }
9694

97-
void mg_socket_finalize() {}
95+
void mg_socket_finalize(void) {}

src/linux/mgsocket.c

+3-5
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
#include <stdlib.h>
1818
#include <string.h>
1919

20-
#include "mgcommon.h"
21-
2220
#ifdef __EMSCRIPTEN__
2321
#include "emscripten.h"
2422
#include "mgwasm.h"
@@ -36,7 +34,7 @@
3634
// Please refer to https://man7.org/linux/man-pages/man2 for more details about
3735
// Linux system calls.
3836

39-
int mg_socket_init() { return MG_SUCCESS; }
37+
int mg_socket_init(void) { return MG_SUCCESS; }
4038

4139
int mg_socket_create(int af, int type, int protocol) {
4240
int sockfd = socket(af, type, protocol);
@@ -151,6 +149,6 @@ int mg_socket_pair(int d, int type, int protocol, int *sv) {
151149

152150
int mg_socket_close(int sock) { return MG_RETRY_ON_EINTR(close(sock)); }
153151

154-
char *mg_socket_error() { return strerror(errno); }
152+
char *mg_socket_error(void) { return strerror(errno); }
155153

156-
void mg_socket_finalize() {}
154+
void mg_socket_finalize(void) {}

src/mgclient.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@
2929
#include "mgtransport.h"
3030
#include "mgvalue.h"
3131

32-
const char *mg_client_version() { return MGCLIENT_VERSION; }
32+
const char *mg_client_version(void) { return MGCLIENT_VERSION; }
3333

34-
int mg_init_session_static_vars() {
34+
int mg_init_session_static_vars(void) {
3535
mg_value *n_val = mg_value_make_integer(-1);
3636
if (!n_val) {
3737
goto fatal_failure;
@@ -55,13 +55,13 @@ int mg_init_session_static_vars() {
5555
return MG_ERROR_CLIENT_ERROR;
5656
}
5757

58-
int mg_init() {
58+
int mg_init(void) {
5959
int init_status = mg_init_session_static_vars();
6060
if (init_status != 0) return init_status;
6161
return mg_socket_init();
6262
}
6363

64-
void mg_finalize() { mg_socket_finalize(); }
64+
void mg_finalize(void) { mg_socket_finalize(); }
6565

6666
typedef struct mg_session_params {
6767
const char *address;
@@ -78,7 +78,7 @@ typedef struct mg_session_params {
7878
void *trust_data;
7979
} mg_session_params;
8080

81-
mg_session_params *mg_session_params_make() {
81+
mg_session_params *mg_session_params_make(void) {
8282
mg_session_params *params =
8383
mg_allocator_malloc(&mg_system_allocator, sizeof(mg_session_params));
8484
if (!params) {

src/mgsocket.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ typedef long ssize_t;
5454

5555
/// Initializes underlying resources. Has to be called at the beginning of a
5656
/// process using socket resources.
57-
int mg_socket_init();
57+
int mg_socket_init(void);
5858

5959
/// Returns a descriptor referencing the new socket or MG_ERROR_SOCKET in the
6060
/// case of any failure.
@@ -110,11 +110,11 @@ int mg_socket_close(int sock);
110110

111111
/// Used to get a native error message after some socket call fails.
112112
/// Has to be called immediately after the failed socket function.
113-
char *mg_socket_error();
113+
char *mg_socket_error(void);
114114

115115
/// Should be called at the end of any process which previously called the
116116
/// \ref mg_socket_init function.
117-
void mg_socket_finalize();
117+
void mg_socket_finalize(void);
118118

119119
#ifdef __cplusplus
120120
}

src/mgtransport.c

+1-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include "mgtransport.h"
1616

1717
#include <assert.h>
18-
#include <errno.h>
1918
#include <stdlib.h>
2019
#include <string.h>
2120
#ifdef MGCLIENT_ON_LINUX
@@ -26,7 +25,6 @@
2625

2726
#include "mgallocator.h"
2827
#include "mgclient.h"
29-
#include "mgcommon.h"
3028
#include "mgsocket.h"
3129
#ifdef __EMSCRIPTEN__
3230
#include "mgwasm.h"
@@ -160,7 +158,7 @@ static char *hex_encode(unsigned char *data, unsigned int len,
160158
return encoded;
161159
}
162160

163-
static void mg_openssl_init() {
161+
static void mg_openssl_init(void) {
164162
#if OPENSSL_VERSION_NUMBER < 0x10100000L
165163
static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
166164
static int mg_ssl_initialized = 0;

src/mgvalue.c

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
#include "mgallocator.h"
2121
#include "mgclient.h"
22-
#include "mgconstants.h"
2322

2423
mg_string *mg_string_alloc(uint32_t size, mg_allocator *allocator) {
2524
char *block = mg_allocator_malloc(allocator, sizeof(mg_string) + size);
@@ -178,7 +177,7 @@ mg_point_3d *mg_point_3d_alloc(mg_allocator *allocator) {
178177
return point_3d;
179178
}
180179

181-
mg_value *mg_value_make_null() {
180+
mg_value *mg_value_make_null(void) {
182181
mg_value *value = mg_allocator_malloc(&mg_system_allocator, sizeof(mg_value));
183182
if (!value) {
184183
return NULL;

0 commit comments

Comments
 (0)