trimmer: free GMatchInfo object in set_bound_from_str
[babeltrace.git] / src / compat / socket.h
index b1fe15978a763a2bdbccca238cb19f971ed09c8f..baf82ad08654e65b16c6a934f77a8c4356dc3622 100644 (file)
@@ -24,6 +24,8 @@
  * SOFTWARE.
  */
 
+#include <stdbool.h>
+
 #ifdef __MINGW32__
 
 #include <winsock2.h>
@@ -33,7 +35,7 @@
 #define BT_SOCKET SOCKET
 
 static inline
-int bt_socket_init(void)
+int bt_socket_init(int log_level)
 {
        WORD verreq;
        WSADATA wsa;
@@ -44,15 +46,17 @@ int bt_socket_init(void)
 
        ret = WSAStartup(verreq, &wsa);
        if (ret != 0) {
-#ifdef BT_LOGE
-               BT_LOGE("Winsock init failed with error: %d", ret);
+#ifdef BT_LOG_WRITE_CUR_LVL
+               BT_LOG_WRITE_CUR_LVL(BT_LOG_ERROR, log_level, BT_LOG_TAG,
+                               "Winsock init failed with error: %d", ret);
 #endif
                goto end;
        }
 
        if (LOBYTE(wsa.wVersion) != 2 || HIBYTE(wsa.wVersion) != 2) {
-#ifdef BT_LOGE_STR
-               BT_LOGE_STR("Could not init winsock 2.2 support");
+#ifdef BT_LOG_WRITE_CUR_LVL
+               BT_LOG_WRITE_CUR_LVL(BT_LOG_ERROR, log_level, BT_LOG_TAG,
+                               "Could not init winsock 2.2 support");
 #endif
                WSACleanup();
                ret = -1;
@@ -272,17 +276,20 @@ const char *bt_socket_errormsg(void)
 
 #else /* __MINGW32__ */
 
-#include <unistd.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
+#include <errno.h>
 #include <netdb.h>
+#include <netinet/in.h>
+#include <sys/socket.h>
+#include <unistd.h>
+
+#include <glib.h>
 
 #define BT_INVALID_SOCKET -1
 #define BT_SOCKET_ERROR -1
 #define BT_SOCKET int
 
 static inline
-int bt_socket_init(void)
+int bt_socket_init(int log_level)
 {
        return 0;
 }
This page took 0.025275 seconds and 4 git commands to generate.