pxl8/src/pxl8_macros.h

18 lines
336 B
C

#pragma once
#include <string.h>
#ifndef pxl8_min
#define pxl8_min(a, b) ((a) < (b) ? (a) : (b))
#endif
#ifndef pxl8_max
#define pxl8_max(a, b) ((a) > (b) ? (a) : (b))
#endif
#ifndef pxl8_strncpy
#define pxl8_strncpy(dst, src, size) do { \
strncpy((dst), (src), (size) - 1); \
(dst)[(size) - 1] = '\0'; \
} while (0)
#endif