libcollectdclient: Add defines for Windows compatibility.
[collectd.git] / src / libcollectdclient / network_buffer.c
index 7b06620..b476794 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * collectd - src/libcollectdclient/network_buffer.c
- * Copyright (C) 2010-2012  Florian octo Forster
+ * Copyright (C) 2010-2014  Florian octo Forster
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
  *   Florian octo Forster <octo at collectd.org>
  **/
 
-#include "config.h"
+#if HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#if WIN32
+
+#include <windows.h>
+#include <math.h>
+#include <assert.h>
+
+#else
 
 #include <stdlib.h>
 #include <string.h>
@@ -57,6 +67,8 @@
 GCRY_THREAD_OPTION_PTHREAD_IMPL;
 #endif
 
+#endif /* !WIN32 */
+
 #include "collectd/network_buffer.h"
 
 #define TYPE_HOST            0x0000
@@ -80,6 +92,10 @@ GCRY_THREAD_OPTION_PTHREAD_IMPL;
 #define PART_SIGNATURE_SHA256_SIZE 36
 #define PART_ENCRYPTION_AES256_SIZE 42
 
+#ifndef ENOTSUP
+# define ENOTSUP -1
+#endif
+
 #define ADD_GENERIC(nb,srcptr,size) do {         \
   assert ((size) <= (nb)->free);                 \
   memcpy ((nb)->ptr, (srcptr), (size));          \
@@ -502,6 +518,7 @@ static int nb_add_value_list (lcc_network_buffer_t *nb, /* {{{ */
   return (0);
 } /* }}} int nb_add_value_list */
 
+/* TODO: Add encryption for Windows */
 #if HAVE_LIBGCRYPT
 static int nb_add_signature (lcc_network_buffer_t *nb) /* {{{ */
 {