]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
marcan's patch until he gets commit access. Remove C library's includes from the...
authorizsh@fail0verflow.com <izsh@fail0verflow.com@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Sat, 20 Feb 2010 03:07:55 +0000 (03:07 +0000)
committerizsh@fail0verflow.com <izsh@fail0verflow.com@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Sat, 20 Feb 2010 03:07:55 +0000 (03:07 +0000)
armsrc/Makefile
armsrc/appmain.c
armsrc/iso15693.c
armsrc/legicrf.c
armsrc/stdint.h [new file with mode: 0644]
bootrom/Makefile
bootrom/stdint.h [new file with mode: 0644]
include/legic_prng.h

index 47f8c73d2c6266512c0554316d047aa64c74fb5d..2614b9e9735898d3c7901463c7d2c8edefc0c65d 100644 (file)
@@ -31,6 +31,9 @@ ARMSRC = fpgaloader.c \
         legic_prng.c \\r
        crc.c\r
 \r
         legic_prng.c \\r
        crc.c\r
 \r
+# stdint.h provided locally until GCC 4.5 becomes C99 compliant\r
+APP_CFLAGS += -I.\r
+\r
 # Do not move this inclusion before the definition of {THUMB,ASM,ARM}SRC\r
 include ../common/Makefile.common\r
 \r
 # Do not move this inclusion before the definition of {THUMB,ASM,ARM}SRC\r
 include ../common/Makefile.common\r
 \r
index b231cae1e27b1623eb734b886aed489efe5986e7..b517fa6cd36c5fe401d02371bf4018cf2ff03fe1 100644 (file)
@@ -6,7 +6,6 @@
 //-----------------------------------------------------------------------------\r
 \r
 #include <proxmark3.h>\r
 //-----------------------------------------------------------------------------\r
 \r
 #include <proxmark3.h>\r
-#include <stdlib.h>\r
 #include "apps.h"\r
 #include "legicrf.h"\r
 #ifdef WITH_LCD\r
 #include "apps.h"\r
 #include "legicrf.h"\r
 #ifdef WITH_LCD\r
@@ -20,6 +19,9 @@
 #define va_end __builtin_va_end\r
 int kvsprintf(char const *fmt, void *arg, int radix, va_list ap);\r
        \r
 #define va_end __builtin_va_end\r
 int kvsprintf(char const *fmt, void *arg, int radix, va_list ap);\r
        \r
+\r
+#define abs(x) ( ((x)<0) ? -(x) : (x) )\r
+\r
 //=============================================================================\r
 // A buffer where we can queue things up to be sent through the FPGA, for\r
 // any purpose (fake tag, as reader, whatever). We go MSB first, since that\r
 //=============================================================================\r
 // A buffer where we can queue things up to be sent through the FPGA, for\r
 // any purpose (fake tag, as reader, whatever). We go MSB first, since that\r
index 4c9a7d607f28c2ca2d8bb6a254d0c21ae2eb5796..acace2954aeab29c510042fa05036a31f3d465be 100644 (file)
@@ -10,8 +10,6 @@
 //-----------------------------------------------------------------------------\r
 #include <proxmark3.h>\r
 #include "apps.h"\r
 //-----------------------------------------------------------------------------\r
 #include <proxmark3.h>\r
 #include "apps.h"\r
-#include <stdio.h>\r
-#include <stdlib.h>\r
 \r
 // FROM winsrc\prox.h //////////////////////////////////\r
 #define arraylen(x) (sizeof(x)/sizeof((x)[0]))\r
 \r
 // FROM winsrc\prox.h //////////////////////////////////\r
 #define arraylen(x) (sizeof(x)/sizeof((x)[0]))\r
index 5b0bf37a5ec05cb2be8061de92557e4b065f82d3..a804ded252cbf4da41fc5bd56bfa49271302192b 100644 (file)
@@ -8,8 +8,7 @@
 
 #include "apps.h"
 #include "legicrf.h"
 
 #include "apps.h"
 #include "legicrf.h"
-#include "unistd.h"
-#include "stdint.h"
+#include <stdint.h>
 
 #include "legic_prng.h"
 #include "crc.h"
 
 #include "legic_prng.h"
 #include "crc.h"
diff --git a/armsrc/stdint.h b/armsrc/stdint.h
new file mode 100644 (file)
index 0000000..8e444b6
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * bits32/stdint.h
+ */
+
+#ifndef _BITSIZE_STDINT_H
+#define _BITSIZE_STDINT_H
+
+typedef signed char            int8_t;
+typedef short int              int16_t;
+typedef int                    int32_t;
+typedef long long int          int64_t;
+
+typedef unsigned char          uint8_t;
+typedef unsigned short int     uint16_t;
+typedef unsigned int           uint32_t;
+typedef unsigned long long int uint64_t;
+
+typedef int                    int_fast16_t;
+typedef int                    int_fast32_t;
+
+typedef unsigned int           uint_fast16_t;
+typedef unsigned int           uint_fast32_t;
+
+typedef int                    intptr_t;
+typedef unsigned int           uintptr_t;
+
+#define __INT64_C(c)   c ## LL
+#define __UINT64_C(c)  c ## ULL
+
+#define __PRI64_RANK   "ll"
+#define __PRIFAST_RANK ""
+#define __PRIPTR_RANK  ""
+
+#endif                         /* _BITSIZE_STDINT_H */
index f88b3cdd2598609f5d5150cf1352cfcac8f658bc..cae1a079a84706bd2bcb31f458f17fdc94eb5fe0 100644 (file)
@@ -12,6 +12,9 @@ ASMSRC = ram-reset.s flash-reset.s
 ARMSRC := $(ARMSRC) $(THUMBSRC)\r
 THUMBSRC := \r
 \r
 ARMSRC := $(ARMSRC) $(THUMBSRC)\r
 THUMBSRC := \r
 \r
+# stdint.h provided locally until GCC 4.5 becomes C99 compliant\r
+APP_CFLAGS = -I.\r
+\r
 # Do not move this inclusion before the definition of {THUMB,ASM,ARM}SRC\r
 include ../common/Makefile.common\r
 \r
 # Do not move this inclusion before the definition of {THUMB,ASM,ARM}SRC\r
 include ../common/Makefile.common\r
 \r
diff --git a/bootrom/stdint.h b/bootrom/stdint.h
new file mode 100644 (file)
index 0000000..8e444b6
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * bits32/stdint.h
+ */
+
+#ifndef _BITSIZE_STDINT_H
+#define _BITSIZE_STDINT_H
+
+typedef signed char            int8_t;
+typedef short int              int16_t;
+typedef int                    int32_t;
+typedef long long int          int64_t;
+
+typedef unsigned char          uint8_t;
+typedef unsigned short int     uint16_t;
+typedef unsigned int           uint32_t;
+typedef unsigned long long int uint64_t;
+
+typedef int                    int_fast16_t;
+typedef int                    int_fast32_t;
+
+typedef unsigned int           uint_fast16_t;
+typedef unsigned int           uint_fast32_t;
+
+typedef int                    intptr_t;
+typedef unsigned int           uintptr_t;
+
+#define __INT64_C(c)   c ## LL
+#define __UINT64_C(c)  c ## ULL
+
+#define __PRI64_RANK   "ll"
+#define __PRIFAST_RANK ""
+#define __PRIPTR_RANK  ""
+
+#endif                         /* _BITSIZE_STDINT_H */
index edcf49cc0f8cac3c295de78bd8a8ccb32a55a817..77c5ec2955b5e827758e038d92bf70a8789d0acc 100644 (file)
@@ -1,5 +1,10 @@
-#include "unistd.h"
-#include "stdint.h"
+#ifndef LEGIC_PRNG_H__
+#define LEGIC_PRNG_H__
+
+#include <stdint.h>
 extern void legic_prng_init(uint8_t init);
 extern void legic_prng_forward(int count);
 extern uint8_t legic_prng_get_bit();
 extern void legic_prng_init(uint8_t init);
 extern void legic_prng_forward(int count);
 extern uint8_t legic_prng_get_bit();
+
+#endif
+
Impressum, Datenschutz