diff --git a/src/datastructures.c b/src/datastructures.c
index e94532efcc49f7f3baab2c9e6caafbd852ce055b..b1e4f754e0b6d1b83d36035c2b92b9eba9cc3f3e 100644
--- a/src/datastructures.c
+++ b/src/datastructures.c
@@ -2,7 +2,7 @@
 #include "hammer.h"
 #include "allocator.h"
 #include <assert.h>
-#include <malloc.h>
+#include <stdlib.h>
 #include <string.h>
 // {{{ counted arrays
 
diff --git a/src/internal.h b/src/internal.h
index 269bc4f59b971c57cd6605abf3749a0bbd872983..67ecb22e4cbf227a8334479ec898cbab83e6d778 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -223,7 +223,7 @@ void  h_hashtable_del(HHashTable* ht, void* key);
 void  h_hashtable_free(HHashTable* ht);
 
 #if 0
-#include <malloc.h>
+#include <stdlib.h>
 #define h_arena_malloc(a, s) malloc(s)
 #endif
 
diff --git a/src/pprint.c b/src/pprint.c
index 3a8df824f9174c9841b18787a294e852d158ae5d..1ffe764349f265f9d381ed10ae3f7567649bd3ec 100644
--- a/src/pprint.c
+++ b/src/pprint.c
@@ -20,7 +20,7 @@
 #include <string.h>
 #include "hammer.h"
 #include "internal.h"
-#include <malloc.h>
+#include <stdlib.h>
 
 typedef struct pp_state {
   int delta;
diff --git a/src/system_allocator.c b/src/system_allocator.c
index 26e2273606bda27e7311a32c49973924d4716502..7248fd2ff35efd24729766c1ba394cbdff4ab2e2 100644
--- a/src/system_allocator.c
+++ b/src/system_allocator.c
@@ -1,4 +1,4 @@
-#include <malloc.h>
+#include <stdlib.h>
 #include "internal.h"
 
 static void* system_alloc(HAllocator *allocator, size_t size) {