* Jerasure
** try multiplication without a lookup table? (to save cache pressure)
* conditional compilation to handle a printf that doesn't understand %Zu
+ * try malloc() instead of alloca() (more portable, possibly better for keeping stacks aligned)
* announce on lwn, p2p-hackers
#include "stdarg.h"
+#if defined(_MSC_VER)
+// actually, some of the flavors (i.e. Enterprise) do support restrict
+//#define restrict __restrict
+#define restrict
+#define inline __inline
+#define alloca _alloca
+#else
+#ifdef __GNUC__
+#define alloca(x) __builtin_alloca(x)
+#else
+#include <alloca.h>
+#endif
+#endif
+
+
+
static PyObject *py_fec_error;
static char fec__doc__[] = "\
* zfec -- fast forward error correction library with Python interface
*/
+#include "fec.h"
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
-#include <alloca.h>
-#include "fec.h"
+#if defined(_MSC_VER)
+// actually, some of the flavors (i.e. Enterprise) do support it
+//#define restrict __restrict
+#define restrict
+#define inline __inline
+#define alloca _alloca
+#else
+#ifdef __GNUC__
+#define alloca(x) __builtin_alloca(x)
+#else
+#include <alloca.h>
+#endif
+#endif
/*
* zfec -- fast forward error correction library with Python interface
*/
-#if defined(_MSC_VER)
-// actually, some of the flavors (i.e. Enterprise) do support it
-//#define restrict __restrict
-#define restrict
-#define inline __inline
-#define alloca _alloca
-#endif
+#include <stddef.h>
typedef unsigned char gf;