more private stuff
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
diff --git a/tommath.h b/tommath.h
index 93fa74c..8e784e8 100644
--- a/tommath.h
+++ b/tommath.h
@@ -22,28 +22,10 @@
#include <tommath_class.h>
-#ifndef MIN
- #define MIN(x,y) (((x) < (y)) ? (x) : (y))
-#endif
-
-#ifndef MAX
- #define MAX(x,y) (((x) > (y)) ? (x) : (y))
-#endif
-
#ifdef __cplusplus
extern "C" {
-
-/* C++ compilers don't like assigning void * to mp_digit * */
-#define OPT_CAST(x) (x *)
-
-#else
-
-/* C on the other hand doesn't care */
-#define OPT_CAST(x)
-
#endif
-
/* detect 64-bit mode if possible */
#if defined(__x86_64__)
#if !(defined(MP_32BIT) || defined(MP_16BIT) || defined(MP_8BIT))
@@ -114,24 +96,6 @@ extern "C" {
#endif
#endif
-/* define heap macros */
-#ifndef CRYPT
- /* default to libc stuff */
- #ifndef XMALLOC
- #define XMALLOC malloc
- #define XFREE free
- #define XREALLOC realloc
- #define XCALLOC calloc
- #else
- /* prototypes for our heap functions */
- extern void *XMALLOC(size_t n);
- extern void *XREALLOC(void *p, size_t n);
- extern void *XCALLOC(size_t n, size_t s);
- extern void XFREE(void *p);
- #endif
-#endif
-
-
/* otherwise the bits per digit is calculated automatically from the size of a mp_digit */
#ifndef DIGIT_BIT
#define DIGIT_BIT (((CHAR_BIT * MP_SIZEOF_MP_DIGIT) - 1)) /* bits per digit */
diff --git a/tommath_private.h b/tommath_private.h
index 5d4ea63..986beac 100644
--- a/tommath_private.h
+++ b/tommath_private.h
@@ -18,8 +18,36 @@
#include <tommath.h>
#include <ctype.h>
+#define MIN(x,y) (((x) < (y)) ? (x) : (y))
+
+#define MAX(x,y) (((x) > (y)) ? (x) : (y))
+
#ifdef __cplusplus
extern "C" {
+
+/* C++ compilers don't like assigning void * to mp_digit * */
+#define OPT_CAST(x) (x *)
+
+#else
+
+/* C on the other hand doesn't care */
+#define OPT_CAST(x)
+
+#endif
+
+/* define heap macros */
+#ifndef XMALLOC
+ /* default to libc stuff */
+ #define XMALLOC malloc
+ #define XFREE free
+ #define XREALLOC realloc
+ #define XCALLOC calloc
+#else
+ /* prototypes for our heap functions */
+ extern void *XMALLOC(size_t n);
+ extern void *XREALLOC(void *p, size_t n);
+ extern void *XCALLOC(size_t n, size_t s);
+ extern void XFREE(void *p);
#endif
/* lowlevel functions, do not call! */