-work around MHD_USE_TLS not being in old MHD versions
[oweals/gnunet.git] / src / include / gnunet_common.h
index 2438b179c1dfc56bb9fd276f2e608e876f1b8b14..4a5051c531a4d5427810266aa82001fd4794f600 100644 (file)
@@ -68,6 +68,11 @@ extern "C"
  */
 #define GNUNET_UTIL_VERSION 0x000A0101
 
+/* support old MHD versions */
+#ifndef MHD_USE_TLS
+#define MHD_USE_TLS MHD_USE_SSL
+#endif
+
 
 /**
  * Named constants for return values.  The following invariants hold:
@@ -807,7 +812,7 @@ GNUNET_ntoh_double (double d);
  * @param m size of the second dimension
  * @param type name of the struct or union, i.e. pass 'struct Foo'.
  */
-#define GNUNET_new_array_2d(n, m, type) (type **) GNUNET_xnew_array_2d_ (n, m, sizeof (type))
+#define GNUNET_new_array_2d(n, m, type) (type **) GNUNET_xnew_array_2d_ (n, m, sizeof (type), __FILE__, __LINE__)
 
 /**
  * @ingroup memory
@@ -819,7 +824,7 @@ GNUNET_ntoh_double (double d);
  * @param o size of the third dimension
  * @param type name of the struct or union, i.e. pass 'struct Foo'.
  */
-#define GNUNET_new_array_3d(n, m, o, type) (type ***) GNUNET_xnew_array_3d_ (n, m, o, sizeof (type))
+#define GNUNET_new_array_3d(n, m, o, type) (type ***) GNUNET_xnew_array_3d_ (n, m, o, sizeof (type), __FILE__, __LINE__)
 
 /**
  * @ingroup memory
@@ -854,7 +859,8 @@ GNUNET_ntoh_double (double d);
 
 /**
  * @ingroup memory
- * Wrapper around realloc. Rellocates size bytes of memory.
+ * Wrapper around realloc. Reallocates size bytes of memory.
+ * The content of the intersection of the new and old size will be unchanged.
  *
  * @param ptr the pointer to reallocate
  * @param size the number of bytes to reallocate
@@ -1000,10 +1006,13 @@ GNUNET_xmalloc_ (size_t size, const char *filename, int linenumber);
  * @param n size of the first dimension
  * @param m size of the second dimension
  * @param elementSize size of a single element in bytes
+ * @param filename where is this call being made (for debugging)
+ * @param linenumber line where this call is being made (for debugging)
  * @return allocated memory, never NULL
  */
 void **
-GNUNET_xnew_array_2d_ (size_t n, size_t m, size_t elementSize);
+GNUNET_xnew_array_2d_ (size_t n, size_t m, size_t elementSize,
+                       const char *filename, int linenumber);
 
 
 /**
@@ -1017,10 +1026,13 @@ GNUNET_xnew_array_2d_ (size_t n, size_t m, size_t elementSize);
  * @param m size of the second dimension
  * @param o size of the third dimension
  * @param elementSize size of a single element in bytes
+ * @param filename where is this call being made (for debugging)
+ * @param linenumber line where this call is being made (for debugging)
  * @return allocated memory, never NULL
  */
 void ***
-GNUNET_xnew_array_3d_ (size_t n, size_t m, size_t o, size_t elementSize);
+GNUNET_xnew_array_3d_ (size_t n, size_t m, size_t o, size_t elementSize,
+                       const char *filename, int linenumber);
 
 
 /**