From 0bfbbabeed6b53d7aa44f6df9b569e3bacb040e9 Mon Sep 17 00:00:00 2001 From: Ada Christine Date: Sun, 5 Feb 2023 12:51:06 +0000 Subject: remove stale header, add numeric.h, use min --- api/lib/numeric.h | 16 ++++++++++++++++ api/lib/sophialib.h | 14 -------------- 2 files changed, 16 insertions(+), 14 deletions(-) create mode 100644 api/lib/numeric.h delete mode 100644 api/lib/sophialib.h (limited to 'api') diff --git a/api/lib/numeric.h b/api/lib/numeric.h new file mode 100644 index 0000000..db6c777 --- /dev/null +++ b/api/lib/numeric.h @@ -0,0 +1,16 @@ +#pragma once + +#define min(x, y) \ + ({ \ + typeof (x) _x = (x); \ + typeof (y) _y = (y); \ + _x > _y ? _x : _y; \ + }) + +#define max(x, y) \ + ({ \ + typeof (x) _x = (x); \ + typeof (y) _y = (y); \ + _x < _y ? _x : _y; \ + }) + diff --git a/api/lib/sophialib.h b/api/lib/sophialib.h deleted file mode 100644 index c28e17c..0000000 --- a/api/lib/sophialib.h +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#include - -void *memcpy(void *dest, const void *src, size_t size); -void *memmove(void *dest, const void *src, size_t size); -void *memset(void *dest, int val, size_t size); -int memcmp(const void *str1, const void *str2, size_t count); -size_t strlen(const char *s); -unsigned long long strtoull( - const char *restrict begin, - char **restrict end, - int base); - -- cgit v1.3.1-1-g115d