-#if defined(i386_TARGET_ARCH)
-static rtsBool execPage (void* addr, int writable);
+/* Heavily arch-specific, I'm afraid.. */
+
+/*
+ * Function: execPage()
+ *
+ * Set the executable bit on page containing addr. CURRENTLY DISABLED.
+ *
+ * TODO: Can the code span more than one page? If yes, we need to make two
+ * pages executable!
+ */
+static rtsBool
+execPage (void* addr, int writable)
+{
+#if defined(i386_TARGET_ARCH) && defined(_WIN32) && 0
+ SYSTEM_INFO sInfo;
+ DWORD dwOldProtect = 0;
+
+ /* doesn't return a result, so presumably it can't fail... */
+ GetSystemInfo(&sInfo);
+
+ if ( VirtualProtect ( (void*)((unsigned long)addr & (sInfo.dwPageSize - 1)),
+ sInfo.dwPageSize,
+ ( writable ? PAGE_EXECUTE_READWRITE : PAGE_EXECUTE_READ),
+ &dwOldProtect) == 0 ) {
+# if 1
+ DWORD rc = GetLastError();
+ fprintf(stderr, "execPage: failed to protect 0x%p; error=%lu; old protection: %lu\n", addr, rc, dwOldProtect);
+# endif
+ return rtsFalse;
+ }
+ return rtsTrue;
+#else
+ (void)addr; (void)writable; /* keep gcc -Wall happy */
+ return rtsTrue;