Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenlib/intern/system.c
| Show All 15 Lines | |||||
| #include "MEM_guardedalloc.h" | #include "MEM_guardedalloc.h" | ||||
| /* for backtrace and gethostname/GetComputerName */ | /* for backtrace and gethostname/GetComputerName */ | ||||
| #if defined(WIN32) | #if defined(WIN32) | ||||
| # include <intrin.h> | # include <intrin.h> | ||||
| # include "BLI_winstuff.h" | # include "BLI_winstuff.h" | ||||
| #else | #else | ||||
| # if defined(HAVE_EXECINFO_H) | |||||
| # include <execinfo.h> | # include <execinfo.h> | ||||
| # endif | |||||
| # include <unistd.h> | # include <unistd.h> | ||||
| #endif | #endif | ||||
| int BLI_cpu_support_sse2(void) | int BLI_cpu_support_sse2(void) | ||||
| { | { | ||||
| #if defined(__x86_64__) || defined(_M_X64) | #if defined(__x86_64__) || defined(_M_X64) | ||||
| /* x86_64 always has SSE2 instructions */ | /* x86_64 always has SSE2 instructions */ | ||||
| return 1; | return 1; | ||||
| Show All 23 Lines | #else | ||||
| return 0; | return 0; | ||||
| #endif | #endif | ||||
| } | } | ||||
| /* Windows stack-walk lives in system_win32.c */ | /* Windows stack-walk lives in system_win32.c */ | ||||
| #if !defined(_MSC_VER) | #if !defined(_MSC_VER) | ||||
| void BLI_system_backtrace(FILE *fp) | void BLI_system_backtrace(FILE *fp) | ||||
| { | { | ||||
| /* ------------- */ | /* ----------------------- */ | ||||
| /* Linux / Apple */ | /* If system as execinfo.h */ | ||||
| # if defined(__linux__) || defined(__APPLE__) | # if defined(HAVE_EXECINFO_H) | ||||
campbellbarton: Does checking `defined(__APPLE__)` make sense now? | |||||
| # define SIZE 100 | # define SIZE 100 | ||||
| void *buffer[SIZE]; | void *buffer[SIZE]; | ||||
| int nptrs; | int nptrs; | ||||
| char **strings; | char **strings; | ||||
| int i; | int i; | ||||
| /* include a backtrace for good measure */ | /* include a backtrace for good measure */ | ||||
| ▲ Show 20 Lines • Show All 106 Lines • Show Last 20 Lines | |||||
Does checking defined(__APPLE__) make sense now?