CONTRIBUTING.adoc: remove BT_LIB_LOGF_APPEND_CAUSE
[babeltrace.git] / src / compat / socket.h
index be63d31ebc3edeaa03af27229e8340e78e2c6d55..7a57678b377e1995b147ce72d9f7aaaf144e0283 100644 (file)
@@ -1,29 +1,15 @@
-#ifndef _BABELTRACE_COMPAT_SOCKET_H
-#define _BABELTRACE_COMPAT_SOCKET_H
-
 /*
- * Copyright (C) 2015-2017  Michael Jeanson <mjeanson@efficios.com>
- *               2015  Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
+ * SPDX-License-Identifier: MIT
  *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
+ * Copyright (C) 2015-2017 Michael Jeanson <mjeanson@efficios.com>
+ * Copyright (C) 2015 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
  */
 
+#ifndef _BABELTRACE_COMPAT_SOCKET_H
+#define _BABELTRACE_COMPAT_SOCKET_H
+
+#include <stdbool.h>
+
 #ifdef __MINGW32__
 
 #include <winsock2.h>
@@ -73,13 +59,13 @@ int bt_socket_fini(void)
 static inline
 int bt_socket_send(int sockfd, const void *buf, size_t len, int flags)
 {
-       return send(sockfd, buf, len, flags);
+       return send(sockfd, (const char *) buf, len, flags);
 }
 
 static inline
 int bt_socket_recv(int sockfd, void *buf, size_t len, int flags)
 {
-       return recv(sockfd, buf, len, flags);
+       return recv(sockfd, (char *) buf, len, flags);
 }
 
 static inline
@@ -274,10 +260,13 @@ 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
This page took 0.025925 seconds and 4 git commands to generate.