Permalink
Browse files

Fix other non-win32 compilation for libzpaq.

  • Loading branch information...
1 parent ee08f31 commit 745c2e2352967d78e9ca906de74d49af71986356 @ckolivas committed Jul 7, 2012
Showing with 5 additions and 5 deletions.
  1. +5 −5 libzpaq/libzpaq.cpp
View
@@ -21,7 +21,7 @@ conforming to the ZPAQ level 2 standard. See http://mattmahoney.net/zpaq/
#include <math.h>
#ifndef NOJIT
-#ifdef unix
+#ifndef _WIN32
#include <sys/mman.h>
#else
#include <windows.h>
@@ -85,7 +85,7 @@ void allocx(U8* &p, int &n, int newsize) {
n=0;
}
if (newsize>0) {
-#ifdef unix
+#ifndef _WIN32
p=(U8*)mmap(0, newsize, PROT_READ|PROT_WRITE|PROT_EXEC,
MAP_PRIVATE|MAP_ANON, -1, 0);
if ((void*)p==MAP_FAILED) p=0;
@@ -1844,7 +1844,7 @@ int ZPAQL::assemble() {
put5(0x48897424,8); // mov [rsp+8], rsi
put5(0x48895424,16); // mov [rsp+16], rdx
put5(0x48894c24,24); // mov [rsp+24], rcx
-#ifdef unix
+#ifndef _WIN32
put2l(0x48bf, this); // mov rdi, this
#else // Windows
put2l(0x48b9, this); // mov rcx, this
@@ -2385,7 +2385,7 @@ int Predictor::assemble_p() {
if (S==4)
put4(0x8b7c2414); // mov edi,[esp+0x14] ; pr
else {
-#ifndef unix
+#ifdef _WIN32
put3(0x4889cf); // mov rdi, rcx (1st arg in Win64)
#endif
}
@@ -2775,7 +2775,7 @@ int Predictor::assemble_p() {
put4(0x8b6c2418); // mov ebp,[esp+0x18] ; (2nd arg = y)
}
else {
-#ifdef unix // (1st arg already in rdi)
+#ifndef _WIN32
put3(0x4889f5); // mov rbp, rsi (2nd arg in Linux-64)
#else
put3(0x4889cf); // mov rdi, rcx (1st arg in Win64)

0 comments on commit 745c2e2

Please sign in to comment.