shithub: snippets

Download patch

ref: 3160d64112b0f517da51ad82ec4f00f0a5ebe6e3
parent: d3bd7f0977707fe012384b3dd6ce5e2a3048704c
author: Sigrid Solveig Haflínudóttir <ftrvxmtrx@gmail.com>
date: Mon Mar 8 04:58:46 EST 2021

helpmeport: add more stuff

--- a/helpmeport
+++ b/helpmeport
@@ -20,6 +20,7 @@
 
 #include <u.h>
 #include <libc.h>
+#include </sys/include/ctype.h>
 #include </sys/include/stdio.h>
 
 typedef enum { false, true } bool;
@@ -41,17 +42,23 @@
 #define INT16_MAX 0x7fff
 #define INT16_MIN ((int16_t)0x8000)
 #define INT64_MIN ((int64_t)0x8000000000000000ULL)
-#define INT_MAX 0x7fffffff
-#define INT_MIN (-INT_MAX-1)
+#define INT32_MAX 0x7fffffff
+#define INT_MAX INT32_MAX
+#define INT32_MIN (-INT32_MAX-1)
+#define INT_MIN INT32_MIN
 #define SHRT_MAX 0x7fff
 #define SHRT_MIN (-SHRT_MAX-1)
 #define SIZE_MAX 0xffffffffU
-#define UINT_MAX 0xffffffffU
+#define UINT32_MAX 0xffffffffU
+#define UINT_MAX UINT32_MAX
+#define UINT64_MAX 0xffffffffffffffffULL
 
 #define PRId64 "lld"
 #define PRIu64 "llud"
 #define PRIx64 "llx"
 
+#define PATH_MAX 256
+
 #define __attribute__(a)
 
 #define exit(x) exits(x == 0 ? nil : "error")
@@ -59,6 +66,10 @@
 #define unsetenv(k) putenv(k,"")
 #define strcasecmp cistrcmp
 #define strncasecmp cistrncmp
+#define getcwd getwd
+#define sinf sin
+#define cosf cos
+#define usleep(x) sleep(x/1000)
 
 #endif
 EOF'