semver: 1.0 -> 1
[awesomized/libmemcached] / include / libmemcached-1 / platform.h
diff --git a/include/libmemcached-1/platform.h b/include/libmemcached-1/platform.h
new file mode 100644 (file)
index 0000000..bfc05e3
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+    +--------------------------------------------------------------------+
+    | libmemcached - C/C++ Client Library for memcached                  |
+    +--------------------------------------------------------------------+
+    | Redistribution and use in source and binary forms, with or without |
+    | modification, are permitted under the terms of the BSD license.    |
+    | You should have received a copy of the license in a bundled file   |
+    | named LICENSE; in case you did not receive a copy you can review   |
+    | the terms online at: https://opensource.org/licenses/BSD-3-Clause  |
+    +--------------------------------------------------------------------+
+    | Copyright (c) 2006-2014 Brian Aker   https://datadifferential.com/ |
+    | Copyright (c) 2020 Michael Wallner   <mike@php.net>                |
+    +--------------------------------------------------------------------+
+*/
+
+#pragma once
+
+#include "libmemcached-1/configure.h"
+
+/* This seems to be required for older compilers @note
+ * http://stackoverflow.com/questions/8132399/how-to-printf-uint64-t  */
+#ifndef __STDC_FORMAT_MACROS
+#  define __STDC_FORMAT_MACROS
+#endif
+
+#ifdef __cplusplus
+#  include <cinttypes>
+#  include <cstddef>
+#  include <cstdlib>
+#else
+#  include <inttypes.h>
+#  include <stddef.h>
+#  include <stdlib.h>
+#  include <stdbool.h>
+#endif
+
+#include <sys/types.h>
+
+#if defined HAVE_NETDB_H
+# include <netdb.h>
+#endif
+
+#if !defined HAVE_IN_PORT_T
+typedef int in_port_t;
+#endif
+
+#if !defined HAVE_PID_T
+typedef int pid_t;
+#endif
+
+#ifndef HAVE_SSIZE_T
+typedef long int ssize_t;
+#endif
+
+#if defined _WIN32
+# include <winsock2.h>
+# include <ws2tcpip.h>
+typedef SOCKET memcached_socket_t;
+#else
+typedef int memcached_socket_t;
+#endif // _WIN32