{"issue":{"state":"closed","created_at":"2011-11-22T19:26:11Z","updated_at":"2011-11-23T07:28:14Z","user":{"gravatar_id":"36eb36a0992c93c2762f5a35ab3e36ac","id":296371,"url":"https://api.github.com/users/zloidemon","login":"zloidemon","avatar_url":"https://secure.gravatar.com/avatar/36eb36a0992c93c2762f5a35ab3e36ac?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"comments":1,"body":"From 0a2d400d832e6d4f0735330ab796395755460184 Mon Sep 17 00:00:00 2001\r\nFrom: Veniamin Gvozdikov <g.veniamin@googlemail.com>\r\nDate: Tue, 22 Nov 2011 19:08:39 +0000\r\nSubject: [PATCH] added support FreeBSD\r\n\r\n---\r\n Makefile          |    3 ++-\r\n lite-hooks-wrap.h |    2 ++\r\n lite-malloc.h     |    7 ++++++-\r\n 3 files changed, 10 insertions(+), 2 deletions(-)\r\n\r\ndiff --git a/Makefile b/Makefile\r\nindex 0fec297..add5b83 100644\r\n--- a/Makefile\r\n+++ b/Makefile\r\n@@ -1,6 +1,7 @@\r\n \r\n # Please specify the directory with boost include files here.\r\n-BOOST_INCLUDES = /usr/include\r\n+PREFIX = /usr/local\r\n+BOOST_INCLUDES = ${PREFIX}/include\r\n \r\n CXX = g++\r\n CFLAGS = -I$(BOOST_INCLUDES) -O3 -finline-functions -Wno-inline -Wall -pthread\r\ndiff --git a/lite-hooks-wrap.h b/lite-hooks-wrap.h\r\nindex 4c28ddf..ae8ed0e 100644\r\n--- a/lite-hooks-wrap.h\r\n+++ b/lite-hooks-wrap.h\r\n@@ -16,7 +16,9 @@\r\n #define __LOCKFREE_LITE_HOOKS_WRAP_H 1\r\n \r\n #include \"lite-malloc.h\"\r\n+#ifndef __FreeBSD__\r\n #include <malloc.h>\r\n+#endif\r\n #include <stdlib.h>\r\n \r\n extern \"C\" {\r\ndiff --git a/lite-malloc.h b/lite-malloc.h\r\nindex 8e5a0c1..badd477 100644\r\n--- a/lite-malloc.h\r\n+++ b/lite-malloc.h\r\n@@ -24,6 +24,11 @@\r\n #include \"l-singleton.h\"\r\n #include \"stack.h\"\r\n \r\n+#ifdef __FreeBSD__\r\n+#define __MAP_ANONYMOUS MAP_ANON\r\n+#else\r\n+#define __MAP_ANONYMOUS MAP_ANONYMOUS\r\n+#endif\r\n \r\n \r\n namespace lite\r\n@@ -159,7 +164,7 @@ private:\r\n         void * p = mmap (hint,\r\n                          size,\r\n                          PROT_WRITE | PROT_READ,\r\n-                         MAP_PRIVATE | MAP_ANONYMOUS | (hint ? MAP_FIXED : 0),\r\n+                         MAP_PRIVATE | __MAP_ANONYMOUS | (hint ? MAP_FIXED : 0),\r\n                          -1 /*fd*/,\r\n                          0);\r\n         return (char *) ((long) p == -1 ? 0 : p);\r\n-- \r\n1.7.7.3\r\n","assignee":null,"number":6,"id":2321902,"labels":[],"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"title":"FreeBSD support","closed_at":"2011-11-23T07:28:14Z","html_url":"https://github.com/Begun/lockfree-malloc/issues/6","milestone":null,"url":"https://api.github.com/repos/Begun/lockfree-malloc/issues/6"},"action":"closed"}