LibLogicalAccess  2.5.0
An Open Source RFID Library
Loading...
Searching...
No Matches
tomcrypt_cfg.h
Go to the documentation of this file.
1/* This is the build config file.
2 *
3 * With this you can setup what to inlcude/exclude automatically during any build. Just comment
4 * out the line that #define's the word for the thing you want to remove. phew!
5 */
6
7#ifndef TOMCRYPT_CFG_H
8#define TOMCRYPT_CFG_H
9
10#if defined(_WIN32) || defined(_MSC_VER)
11#define LTC_CALL __cdecl
12#else
13#ifndef LTC_CALL
14#define LTC_CALL
15#endif
16#endif
17
18#ifndef LTC_EXPORT
19#define LTC_EXPORT
20#endif
21
22/* certain platforms use macros for these, making the prototypes broken */
23#ifndef LTC_NO_PROTOTYPES
24
25/* you can change how memory allocation works ... */
26LTC_EXPORT void * LTC_CALL XMALLOC(size_t n);
27LTC_EXPORT void * LTC_CALL XREALLOC(void *p, size_t n);
28LTC_EXPORT void * LTC_CALL XCALLOC(size_t n, size_t s);
30
31LTC_EXPORT void LTC_CALL XQSORT(void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *));
32
33/* change the clock function too */
35
36/* various other functions */
37LTC_EXPORT void * LTC_CALL XMEMCPY(void *dest, const void *src, size_t n);
38LTC_EXPORT int LTC_CALL XMEMCMP(const void *s1, const void *s2, size_t n);
39LTC_EXPORT void * LTC_CALL XMEMSET(void *s, int c, size_t n);
40
41LTC_EXPORT int LTC_CALL XSTRCMP(const char *s1, const char *s2);
42
43#endif
44
45/* type of argument checking, 0=default, 1=fatal and 2=error+continue, 3=nothing */
46#ifndef ARGTYPE
47#define ARGTYPE 0
48#endif
49
50/* Controls endianess and size of registers. Leave uncommented to get platform neutral [slower] code
51 *
52 * Note: in order to use the optimized macros your platform must support unaligned 32 and 64 bit read/writes.
53 * The x86 platforms allow this but some others [ARM for instance] do not. On those platforms you **MUST**
54 * use the portable [slower] macros.
55 */
56
57/* detect x86-32 machines somewhat */
58#if !defined(__STRICT_ANSI__) && (defined(INTEL_CC) || (defined(_MSC_VER) && defined(WIN32)) || (defined(__GNUC__) && (defined(__DJGPP__) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__i386__))))
59#define ENDIAN_LITTLE
60#define ENDIAN_32BITWORD
61#define LTC_FAST
62#define LTC_FAST_TYPE unsigned long
63#endif
64
65/* detects MIPS R5900 processors (PS2) */
66#if (defined(__R5900) || defined(R5900) || defined(__R5900__)) && (defined(_mips) || defined(__mips__) || defined(mips))
67#define ENDIAN_LITTLE
68#define ENDIAN_64BITWORD
69#endif
70
71/* detect amd64 */
72#if !defined(__STRICT_ANSI__) && defined(__x86_64__)
73#define ENDIAN_LITTLE
74#define ENDIAN_64BITWORD
75#define LTC_FAST
76#define LTC_FAST_TYPE unsigned long
77#endif
78
79/* detect PPC32 */
80#if !defined(__STRICT_ANSI__) && defined(LTC_PPC32)
81#define ENDIAN_BIG
82#define ENDIAN_32BITWORD
83#define LTC_FAST
84#define LTC_FAST_TYPE unsigned long
85#endif
86
87/* detect sparc and sparc64 */
88#if defined(__sparc__)
89#define ENDIAN_BIG
90#if defined(__arch64__)
91#define ENDIAN_64BITWORD
92#else
93#define ENDIAN_32BITWORD
94#endif
95#endif
96
97#ifdef LTC_NO_FAST
98#ifdef LTC_FAST
99#undef LTC_FAST
100#endif
101#endif
102
103/* No asm is a quick way to disable anything "not portable" */
104#ifdef LTC_NO_ASM
105#undef ENDIAN_LITTLE
106#undef ENDIAN_BIG
107#undef ENDIAN_32BITWORD
108#undef ENDIAN_64BITWORD
109#undef LTC_FAST
110#undef LTC_FAST_TYPE
111#define LTC_NO_ROLC
112#define LTC_NO_BSWAP
113#endif
114
115/* #define ENDIAN_LITTLE */
116/* #define ENDIAN_BIG */
117
118/* #define ENDIAN_32BITWORD */
119/* #define ENDIAN_64BITWORD */
120
121#if (defined(ENDIAN_BIG) || defined(ENDIAN_LITTLE)) && !(defined(ENDIAN_32BITWORD) || defined(ENDIAN_64BITWORD))
122#error You must specify a word size as well as endianess in tomcrypt_cfg.h
123#endif
124
125#if !(defined(ENDIAN_BIG) || defined(ENDIAN_LITTLE))
126#define ENDIAN_NEUTRAL
127#endif
128
129#endif
130
131/* $Source$ */
132/* $Revision$ */
133/* $Date$ */
LTC_EXPORT clock_t LTC_CALL XCLOCK(void)
#define LTC_EXPORT
Definition: tomcrypt_cfg.h:19
#define LTC_CALL
Definition: tomcrypt_cfg.h:14
#define XMALLOC
Definition: tomcrypt_custom.h:9
#define XREALLOC
Definition: tomcrypt_custom.h:15
#define XMEMCPY
Definition: tomcrypt_custom.h:40
#define XQSORT
Definition: tomcrypt_custom.h:66
#define XCALLOC
Definition: tomcrypt_custom.h:21
#define XSTRCMP
Definition: tomcrypt_custom.h:52
#define XMEMCMP
Definition: tomcrypt_custom.h:46
#define XMEMSET
Definition: tomcrypt_custom.h:34
#define XFREE
Definition: tomcrypt_custom.h:27