Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion crnlib/crn_jpge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@

#include <stdlib.h>
#include <string.h>
#if defined(__APPLE__)
#if defined(__FreeBSD__)
// <malloc.h> has been replaced by <stdlib.h>
#include <malloc_np.h> // for malloc_usable_size
#elif defined(__APPLE__)
#include <malloc/malloc.h>
#else
#include <malloc.h>
Expand Down
5 changes: 4 additions & 1 deletion crnlib/crn_mem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
#include "crn_core.h"
#include "crn_console.h"
#include "../inc/crnlib.h"
#if defined(__APPLE__)
#if defined(__FreeBSD__)
// <malloc.h> has been replaced by <stdlib.h>
#include <malloc_np.h> // for malloc_usable_size
#elif defined(__APPLE__)
#include <malloc/malloc.h>
#else
#include <malloc.h>
Expand Down
4 changes: 2 additions & 2 deletions crnlib/crn_threading_pthreads.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "crn_winhdr.h"
#endif

#if defined(__APPLE__)
#if defined(__FreeBSD__) || defined(__APPLE__)
#include <sys/sysctl.h>
#elif defined(__GNUC__)
#include <sys/sysinfo.h>
Expand All @@ -29,7 +29,7 @@ void crn_threading_init() {
SYSTEM_INFO g_system_info;
GetSystemInfo(&g_system_info);
g_number_of_processors = math::maximum<uint>(1U, g_system_info.dwNumberOfProcessors);
#elif defined(__APPLE__)
#elif defined(__FreeBSD__) || defined(__APPLE__)
g_number_of_processors = math::maximum<int>(1, sysconf(_SC_NPROCESSORS_ONLN));
#elif defined(__GNUC__)
g_number_of_processors = math::maximum<int>(1, get_nprocs());
Expand Down
4 changes: 4 additions & 0 deletions crnlib/crn_timer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
#include "crn_timer.h"
#include <time.h>

#if defined(__FreeBSD__)
#include "sys/time.h"
#endif

#include "crn_timer.h"

#if CRNLIB_USE_WIN32_API
Expand Down