aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-09-02 19:45:09 +0200
committerMattias Andrée <maandree@operamail.com>2015-09-02 19:45:09 +0200
commitf252c29710f71e7c260d9e866c8d4eef885705c3 (patch)
tree22614e2bfc48b2901055484eed2f049d9ec4104e /include
parentm (diff)
downloadslibc-f252c29710f71e7c260d9e866c8d4eef885705c3.tar.gz
slibc-f252c29710f71e7c260d9e866c8d4eef885705c3.tar.bz2
slibc-f252c29710f71e7c260d9e866c8d4eef885705c3.tar.xz
fix some warnings and errors
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'include')
-rw-r--r--include/bits/types.h12
-rw-r--r--include/inttypes.h3
-rw-r--r--include/stdlib.h17
-rw-r--r--include/string.h3
4 files changed, 29 insertions, 6 deletions
diff --git a/include/bits/types.h b/include/bits/types.h
index 5d99e4f..83087b5 100644
--- a/include/bits/types.h
+++ b/include/bits/types.h
@@ -362,3 +362,15 @@ typedef struct {
} imaxdiv_t;
#endif
+
+/**
+ * Locale datatype.
+ */
+#if defined(__NEED_locale_t) && !defined(__DEFINED_locale_t)
+# define __DEFINED_locale_t
+typedef struct __locale locale_t; /* TODO not implemented */
+#endif
+#ifndef __INTMAX_MAX
+# define __INTMAX_MAX INT64_MAX
+#endif
+
diff --git a/include/inttypes.h b/include/inttypes.h
index dac5e27..3f24e9b 100644
--- a/include/inttypes.h
+++ b/include/inttypes.h
@@ -37,7 +37,8 @@
* @return The quotient in `.quot`, and
* the remainder in `.rem`.
*/
-imaxdiv_t imaxdiv(intmax_t, intmax_t);
+imaxdiv_t imaxdiv(intmax_t, intmax_t)
+ __GCC_ONLY(__attribute__((const)));
diff --git a/include/stdlib.h b/include/stdlib.h
index fd78d27..9340201 100644
--- a/include/stdlib.h
+++ b/include/stdlib.h
@@ -65,7 +65,8 @@
* @return The quotient in `.quot`, and
* the remainder in `.rem`.
*/
-div_t div(int, int);
+div_t div(int, int)
+ __GCC_ONLY(__attribute__((const)));
/**
* Perform an integer division and return
@@ -76,7 +77,8 @@ div_t div(int, int);
* @return The quotient in `.quot`, and
* the remainder in `.rem`.
*/
-ldiv_t ldiv(long, long);
+ldiv_t ldiv(long, long)
+ __GCC_ONLY(__attribute__((const)));
/**
* Perform an integer division and return
@@ -87,7 +89,16 @@ ldiv_t ldiv(long, long);
* @return The quotient in `.quot`, and
* the remainder in `.rem`.
*/
-lldiv_t lldiv(long long, long long);
+lldiv_t lldiv(long long, long long)
+ __GCC_ONLY(__attribute__((const)));
+
+
+
+/* TODO implement rand-functions */
+#define RAND_MAX 1
+int rand(void);
+int rand_r(unsigned int* seed);
+void srand(unsigned int seed);
diff --git a/include/string.h b/include/string.h
index 483b49b..53aaca6 100644
--- a/include/string.h
+++ b/include/string.h
@@ -31,8 +31,7 @@
#define __NEED_size_t
-#define __NEED_locale_t /* TODO not defined */
-
+#define __NEED_locale_t
#include <bits/types.h>