@@ -13,6 +13,7 @@
#include <stdint.h>
#include <stdarg.h>
#include <stddef.h>
+#include <limits.h>
#include "util.h"
#include "stm32f10x_regs.h"
@@ -19,9 +19,6 @@ typedef char bool_t;
#define TRUE 1
#define FALSE 0
-#define LONG_MAX ((long int)((~0UL)>>1))
-#define LONG_MIN ((long int)~LONG_MAX)
-
#ifndef offsetof
#define offsetof(a,b) __builtin_offsetof(a,b)
#endif
@@ -119,7 +119,7 @@ size_t strnlen(const char *s, size_t maxlen)
int strcmp(const char *s1, const char *s2)
{
- return strncmp(s1, s2, ~0);
+ return strncmp(s1, s2, INT_MAX);
}
int strncmp(const char *s1, const char *s2, size_t n)