Mercurial > hg > forks > bilotrip-mj12
view src/platform.c @ 45:d85542c96791
Clean up the build some more, move platform specifics again.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 06 Aug 2013 00:23:45 +0300 |
parents | 785057719d9b |
children |
line wrap: on
line source
#include "platform.h" #if defined(_WIN32) || defined(_WIN64) #include <math.h> double round(float v) { return floor(v + 0.5f); } #endif #if defined(__APPLE__) || defined(_WIN32) || defined(_WIN64) char * strndup(const char *s, size_t n) { char *result = malloc(n + 1); if (result == NULL) return NULL; memcpy(result, s, n); result[n] = 0; return result; } #endif