summaryrefslogtreecommitdiff
path: root/src/common/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/include')
-rw-r--r--src/common/include/stdlib_common.h8
-rw-r--r--src/common/include/string.h8
-rw-r--r--src/common/include/types.h4
3 files changed, 18 insertions, 2 deletions
diff --git a/src/common/include/stdlib_common.h b/src/common/include/stdlib_common.h
index 80c188f..dc40b96 100644
--- a/src/common/include/stdlib_common.h
+++ b/src/common/include/stdlib_common.h
@@ -6,9 +6,17 @@
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void *memcpy(void *dest, const void *src, int count);
void *memset(void *dest, int val, int count);
uint16_t *memsetw(uint16_t *dest, uint16_t val, int count);
+#ifdef __cplusplus
+}
+#endif
+
#endif
diff --git a/src/common/include/string.h b/src/common/include/string.h
index a41459e..e6aa86e 100644
--- a/src/common/include/string.h
+++ b/src/common/include/string.h
@@ -4,6 +4,10 @@
// #include <stdlib.h>
#include <types.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
int strlen(const char *str);
char *strcpy(char *dest, const char *src);
// char *strdup(const char *src); // uses malloc, that's bad
@@ -11,4 +15,8 @@ char *strchr(const char *str, char c);
char *strcat(char *dest, const char *src);
int strcmp(const char *s1, const char *s2);
+#ifdef __cplusplus
+}
+#endif
+
#endif
diff --git a/src/common/include/types.h b/src/common/include/types.h
index ec24ce5..e7c1a35 100644
--- a/src/common/include/types.h
+++ b/src/common/include/types.h
@@ -2,7 +2,7 @@
#define DEF_TYPES_H
typedef unsigned long long uint64_t;
-typedef unsigned int uint32_t;
+typedef unsigned long int uint32_t;
typedef unsigned short uint16_t;
typedef unsigned char uint8_t;
typedef long long int64_t;
@@ -10,7 +10,7 @@ typedef int int32_t;
typedef short int16_t;
typedef char int8_t;
-typedef unsigned int size_t;
+typedef long unsigned int size_t;
#define NULL 0