TriKaspar/php_riak — pull request #29 by weltling (2013-09-15 00:04:55+00:00)
Title: windows fixes

Please consider to put the riack lib into the PECL tgz, otherwise the build will always fail, on Windows at least. Also please be sure applying the following to the riak lib

$ diff -ru riack.orig riack
Only in riack.orig: .git
diff -ru riack.orig/src/ints.h riack/src/ints.h
--- riack.orig/src/ints.h Sun Sep 15 01:20:33 2013
+++ riack/src/ints.h Sun Sep 15 01:22:25 2013
@@ -5,7 +5,7 @@
#include "riack-config.h"
#endif

-#if defined(HAVE_STDINT_H)
+#if defined(HAVE_STDINT_H) && !defined(_WIN32)
#include
#else
#define int32_t signed __int32
diff -ru riack.orig/src/riack.c riack/src/riack.c
--- riack.orig/src/riack.c Sun Sep 15 01:20:33 2013
+++ riack/src/riack.c Sun Sep 15 01:16:17 2013
@@ -461,9 +461,10 @@
struct RIACK_COMMIT_HOOK* riack_rpb_hooks_to_hooks(struct RIACK_CLIENT *client, RpbCommitHook ** rpb_hooks, size_t hook_count)
{
size_t i;
+ struct RIACK_COMMIT_HOOK* result;
if (hook_count == 0) return 0;

- struct RIACK_COMMIT_HOOK* result = RCALLOC(client, sizeof(struct RIACK_COMMIT_HOOK*) * hook_count);
+ result = RCALLOC(client, sizeof(struct RIACK_COMMIT_HOOK*) * hook_count);
for (i=0; ihas_name) {
RMALLOCCOPY(client, result[i].name.value, result[i].name.len, rpb_hooks[i]->name.data, rpb_hooks[i]->name.len);

You might also consider to PR this patch to the upstream.

With this fixes I currently could build the last riak ext release on windows and it built just fine. You should have some mail about those builds in your mailbox, if no - look under http://windows.php.net/downloads/pecl/releases/riak/0.5.1/ . Please note that you'll probably need to fix some of the protobuf stuff on Windows x64 (see the build logs).