denyhosts/clamav/libclamav/tomsfastmath/misc/fp_ident.c

99 lines
1.6 KiB
C
Raw Permalink Normal View History

2022-10-22 18:41:00 +08:00
/* TomsFastMath, a fast ISO C bignum library.
2023-01-14 18:28:39 +08:00
*
2022-10-22 18:41:00 +08:00
* This project is meant to fill in where LibTomMath
* falls short. That is speed ;-)
*
* This project is public domain and free for all purposes.
2023-01-14 18:28:39 +08:00
*
2022-10-22 18:41:00 +08:00
* Tom St Denis, tomstdenis@gmail.com
*/
2023-01-14 18:28:39 +08:00
#include <tfm_private.h>
2022-10-22 18:41:00 +08:00
const char *fp_ident(void)
{
static char buf[1024];
memset(buf, 0, sizeof(buf));
snprintf(buf, sizeof(buf)-1,
2023-01-14 18:28:39 +08:00
"TomsFastMath " TFM_VERSION_S "\n"
#if defined(TFM_IDENT_BUILD_DATE)
"Built on " __DATE__ " at " __TIME__ "\n"
#endif
2022-10-22 18:41:00 +08:00
"\n"
"Sizeofs\n"
2023-01-14 18:28:39 +08:00
"\tfp_digit = %lu\n"
"\tfp_word = %lu\n"
2022-10-22 18:41:00 +08:00
"\n"
"FP_MAX_SIZE = %u\n"
"\n"
"Defines: \n"
#ifdef __i386__
" __i386__ "
#endif
#ifdef __x86_64__
" __x86_64__ "
#endif
#ifdef TFM_X86
" TFM_X86 "
#endif
#ifdef TFM_X86_64
" TFM_X86_64 "
#endif
#ifdef TFM_SSE2
" TFM_SSE2 "
#endif
#ifdef TFM_ARM
" TFM_ARM "
#endif
#ifdef TFM_PPC32
" TFM_PPC32 "
#endif
#ifdef TFM_AVR32
" TFM_AVR32 "
#endif
#ifdef TFM_ECC192
" TFM_ECC192 "
#endif
#ifdef TFM_ECC224
" TFM_ECC224 "
#endif
#ifdef TFM_ECC384
" TFM_ECC384 "
#endif
#ifdef TFM_ECC521
" TFM_ECC521 "
#endif
#ifdef TFM_NO_ASM
" TFM_NO_ASM "
#endif
#ifdef FP_64BIT
" FP_64BIT "
#endif
#ifdef TFM_HUGE
" TFM_HUGE "
#endif
2023-01-14 18:28:39 +08:00
"\n", (unsigned long)sizeof(fp_digit), (unsigned long)sizeof(fp_word), FP_MAX_SIZE);
2022-10-22 18:41:00 +08:00
if (sizeof(fp_digit) == sizeof(fp_word)) {
2023-01-14 18:28:39 +08:00
strncat(buf, "WARNING: sizeof(fp_digit) == sizeof(fp_word), this build is likely to not work properly.\n",
sizeof(buf) - strlen(buf) - 1);
2022-10-22 18:41:00 +08:00
}
return buf;
}
#ifdef STANDALONE
int main(void)
{
printf("%s\n", fp_ident());
return 0;
}
#endif
2023-01-14 18:28:39 +08:00
/* $Source$ */
/* $Revision$ */
/* $Date$ */