summaryrefslogtreecommitdiff
path: root/lib/ultralib/include/compiler/modern_gcc/stdlib.h
diff options
context:
space:
mode:
authorDerek Hensley <hensley.derek58@gmail.com>2025-02-21 16:03:51 -0800
committerGitHub <noreply@github.com>2025-02-21 17:03:51 -0700
commit8c6ae625aef6d07741cd8925f422f43ae24b198c (patch)
tree741fafdf5cf11006a23a9019451082c269fe4922 /lib/ultralib/include/compiler/modern_gcc/stdlib.h
parentf013a028f42a1b11134bc5f22f28e9f48236b6f0 (diff)
Ultralib Update (#233)
* git subrepo pull (merge) lib/ultralib subrepo: subdir: "lib/ultralib" merged: "74f0eee" upstream: origin: "git@github.com:decompals/ultralib.git" branch: "main" commit: "2717d45" git-subrepo: version: "0.4.9" origin: "https://github.com/ingydotnet/git-subrepo" commit: "cce3d93" * New ultralib fixes * Update some includes in tools * git subrepo commit (merge) lib/ultralib subrepo: subdir: "lib/ultralib" merged: "3a702eaf" upstream: origin: "git@github.com:decompals/ultralib.git" branch: "main" commit: "48f9f908" git-subrepo: version: "0.4.9" origin: "git@github.com:ingydotnet/git-subrepo.git" commit: "ea10886" * Update warnings file
Diffstat (limited to 'lib/ultralib/include/compiler/modern_gcc/stdlib.h')
-rw-r--r--lib/ultralib/include/compiler/modern_gcc/stdlib.h81
1 files changed, 81 insertions, 0 deletions
diff --git a/lib/ultralib/include/compiler/modern_gcc/stdlib.h b/lib/ultralib/include/compiler/modern_gcc/stdlib.h
new file mode 100644
index 0000000..98f8a2e
--- /dev/null
+++ b/lib/ultralib/include/compiler/modern_gcc/stdlib.h
@@ -0,0 +1,81 @@
+#ifndef _STDLIB_H
+#define _STDLIB_H
+/*
+ stdlib.h
+*/
+
+#ifndef _SIZE_T_DEF
+#define _SIZE_T_DEF
+typedef unsigned size_t;
+#endif
+
+#ifndef _DIV_T_DEF
+#define _DIV_T_DEF
+typedef struct DIV_T {
+ int quot;
+ int rem;
+} div_t;
+#endif
+
+#ifndef _LDIV_T_DEF
+#define _LDIV_T_DEF
+typedef struct LDIV_T {
+ long quot;
+ long rem;
+} ldiv_t;
+#endif
+
+#ifndef _LLDIV_T_DEF
+#define _LLDIV_T_DEF
+typedef struct lldiv_t
+{
+ long long quot;
+ long long rem;
+} lldiv_t;
+#endif
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+#define _max(a,b) (((a) > (b)) ? (a) : (b))
+#define _min(a,b) (((a) < (b)) ? (a) : (b))
+
+#define RAND_MAX 32767
+
+int rand(void);
+void srand(unsigned);
+
+int abs(int);
+long labs(long);
+
+div_t div(int,int);
+ldiv_t ldiv(long,long);
+lldiv_t lldiv(long long, long long);
+
+int atoi(const char *);
+long atol(const char *);
+
+long strtol(const char *,char **,int);
+unsigned long strtoul(const char *,char **,int);
+
+char *itoa(int,char *,int);
+char *ltoa(long,char *,int);
+char *ultoa(unsigned long,char *,int);
+
+double atof(const char *);
+double strtod(const char *,char **);
+
+void qsort(void *,size_t,size_t,int (*)(const void *,const void *));
+void *bsearch(const void *,const void *,size_t,size_t,int (*)(const void *,const void *));
+
+void *malloc(size_t);
+void *calloc(size_t,size_t);
+void *realloc(void *,size_t);
+void free(void *);
+
+void exit(int);
+
+void abort(void);
+
+#endif