1 /* This is the build config file.
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!
10 #if defined(_WIN32) || defined(_MSC_VER)
11 #define LTC_CALL __cdecl
22 /* certain platforms use macros for these, making the prototypes broken */
23 #ifndef LTC_NO_PROTOTYPES
25 /* you can change how memory allocation works ... */
26 LTC_EXPORT void * LTC_CALL XMALLOC(size_t n);
27 LTC_EXPORT void * LTC_CALL XREALLOC(void *p, size_t n);
28 LTC_EXPORT void * LTC_CALL XCALLOC(size_t n, size_t s);
29 LTC_EXPORT void LTC_CALL XFREE(void *p);
31 LTC_EXPORT void LTC_CALL XQSORT(void *base, size_t nmemb, size_t size, int(*compar)(const void *, const void *));
34 /* change the clock function too */
35 LTC_EXPORT clock_t LTC_CALL XCLOCK(void);
37 /* various other functions */
38 LTC_EXPORT void * LTC_CALL XMEMCPY(void *dest, const void *src, size_t n);
39 LTC_EXPORT int LTC_CALL XMEMCMP(const void *s1, const void *s2, size_t n);
40 LTC_EXPORT void * LTC_CALL XMEMSET(void *s, int c, size_t n);
42 LTC_EXPORT int LTC_CALL XSTRCMP(const char *s1, const char *s2);
46 /* type of argument checking, 0=default, 1=fatal and 2=error+continue, 3=nothing */
51 /* Controls endianess and size of registers. Leave uncommented to get platform neutral [slower] code
53 * Note: in order to use the optimized macros your platform must support unaligned 32 and 64 bit read/writes.
54 * The x86 platforms allow this but some others [ARM for instance] do not. On those platforms you **MUST**
55 * use the portable [slower] macros.
58 /* detect x86-32 machines somewhat */
59 #if !defined(__STRICT_ANSI__) && (defined(INTEL_CC) || (defined(_MSC_VER) && defined(WIN32)) || (defined(__GNUC__) && (defined(__DJGPP__) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__i386__))))
61 #define ENDIAN_32BITWORD
63 #define LTC_FAST_TYPE unsigned long
66 /* detects MIPS R5900 processors (PS2) */
67 #if (defined(__R5900) || defined(R5900) || defined(__R5900__)) && (defined(_mips) || defined(__mips__) || defined(mips))
69 #define ENDIAN_64BITWORD
73 #if !defined(__STRICT_ANSI__) && defined(__x86_64__)
75 #define ENDIAN_64BITWORD
77 #define LTC_FAST_TYPE unsigned long
81 #if !defined(__STRICT_ANSI__) && defined(LTC_PPC32)
83 #define ENDIAN_32BITWORD
85 #define LTC_FAST_TYPE unsigned long
88 /* detect sparc and sparc64 */
89 #if defined(__sparc__)
91 #if defined(__arch64__)
92 #define ENDIAN_64BITWORD
94 #define ENDIAN_32BITWORD
105 /* No asm is a quick way to disable anything "not portable" */
109 #undef ENDIAN_32BITWORD
110 #undef ENDIAN_64BITWORD
117 /* #define ENDIAN_LITTLE */
118 /* #define ENDIAN_BIG */
120 /* #define ENDIAN_32BITWORD */
121 /* #define ENDIAN_64BITWORD */
123 #if (defined(ENDIAN_BIG) || defined(ENDIAN_LITTLE)) && !(defined(ENDIAN_32BITWORD) || defined(ENDIAN_64BITWORD))
124 #error You must specify a word size as well as endianess in tomcrypt_cfg.h
127 #if !(defined(ENDIAN_BIG) || defined(ENDIAN_LITTLE))
128 #define ENDIAN_NEUTRAL
134 /* $Source: /cvs/libtom/libtomcrypt/src/headers/tomcrypt_cfg.h,v $ */
135 /* $Revision: 1.19 $ */
136 /* $Date: 2006/12/04 02:19:48 $ */