summaryrefslogtreecommitdiffstats
path: root/generic/tclTomMathDecls.h
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tclTomMathDecls.h')
-rw-r--r--generic/tclTomMathDecls.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/generic/tclTomMathDecls.h b/generic/tclTomMathDecls.h
index f199a2a..736a640 100644
--- a/generic/tclTomMathDecls.h
+++ b/generic/tclTomMathDecls.h
@@ -56,6 +56,9 @@
# define MODULE_SCOPE extern
#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
MODULE_SCOPE mp_err TclBN_s_mp_add_d(const mp_int *a, mp_digit b, mp_int *c);
MODULE_SCOPE mp_ord TclBN_s_mp_cmp_d(const mp_int *a, mp_digit b);
MODULE_SCOPE mp_err TclBN_s_mp_div_d(const mp_int *a, mp_digit b, mp_int *c, mp_digit *d);
@@ -66,7 +69,9 @@ MODULE_SCOPE mp_err TclBN_s_mp_mul_d(const mp_int *a, mp_digit b, mp_int *c);
MODULE_SCOPE void TclBN_s_mp_reverse(unsigned char *s, size_t len);
MODULE_SCOPE void TclBN_s_mp_set(mp_int *a, mp_digit b);
MODULE_SCOPE mp_err TclBN_s_mp_sub_d(const mp_int *a, mp_digit b, mp_int *c);
-
+#ifdef __cplusplus
+}
+#endif
/* Rename the global symbols in libtommath to avoid linkage conflicts */
@@ -740,6 +745,9 @@ extern const TclTomMathStubs *tclTomMathStubsPtr;
#undef mp_isodd
#define mp_iseven(a) (!mp_isodd(a))
#define mp_isodd(a) (((a)->used != 0 && (((a)->dp[0] & 1) != 0)) ? MP_YES : MP_NO)
+#undef mp_sqr
+#define mp_sqr(a,b) mp_mul(a,a,b)
+
#undef TCL_STORAGE_CLASS
#define TCL_STORAGE_CLASS DLLIMPORT