aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2020-10-05 13:36:22 +0200
committerAndreas Schneider <asn@cryptomilk.org>2020-10-12 08:25:26 +0200
commit00b3deb56dc45819496277d28435a273e6b9b602 (patch)
tree4a2a6c802aa5d7f75263eaeff89cbab43caca820
parent36b929f0fbfc17a70a5b61a0583dfdac147244c4 (diff)
downloadcmocka-00b3deb56dc45819496277d28435a273e6b9b602.tar.gz
cmocka-00b3deb56dc45819496277d28435a273e6b9b602.tar.xz
cmocka-00b3deb56dc45819496277d28435a273e6b9b602.zip
cmocka: Move PrintFormat defines to C file
-rw-r--r--include/cmocka.h34
-rw-r--r--src/cmocka.c33
2 files changed, 33 insertions, 34 deletions
diff --git a/include/cmocka.h b/include/cmocka.h
index f8c1ec2..8523df8 100644
--- a/include/cmocka.h
+++ b/include/cmocka.h
@@ -57,40 +57,6 @@ int __stdcall IsDebuggerPresent();
* @{
*/
-/* Printf format used to display uintmax_t as a hexidecimal. */
-#ifndef UintMaxTypePrintfFormat
-# ifdef _WIN32
-# define UintMaxTypePrintfFormat "0x%I64x"
-# else
-# if __WORDSIZE == 64
-# define UintMaxTypePrintfFormat "%#lx"
-# else
-# define UintMaxTypePrintfFormat "%#llx"
-# endif
-# endif /* _WIN32 */
-#endif /* UintMaxTypePrintfFormat */
-
-/* Printf format used to display uintmax_t as a decimal. */
-#ifndef UintMaxTypePrintfFormatDecimal
-# ifdef _WIN32
-# define UintMaxTypePrintfFormatDecimal "%I64u"
-# else
-# if __WORDSIZE == 64
-# define UintMaxTypePrintfFormatDecimal "%lu"
-# else
-# define UintMaxTypePrintfFormatDecimal "%llu"
-# endif
-# endif /* _WIN32 */
-#endif /* UintMaxTypePrintfFormat */
-
-#ifndef FloatPrintfFormat
-# define FloatPrintfFormat "%f"
-#endif /* FloatPrintfFormat */
-
-#ifndef DoublePrintfFormat
-# define DoublePrintfFormat "%f"
-#endif /* DoublePrintfFormat */
-
/* Perform an unsigned cast to uintmax_t. */
#define cast_to_largest_integral_type(value) \
((uintmax_t)(value))
diff --git a/src/cmocka.c b/src/cmocka.c
index d94feb0..513eb9d 100644
--- a/src/cmocka.c
+++ b/src/cmocka.c
@@ -109,6 +109,39 @@
# define cm_longjmp(env, val) longjmp(env, val)
#endif
+/* Printf format used to display uintmax_t as a hexidecimal. */
+#ifndef UintMaxTypePrintfFormat
+# ifdef _WIN32
+# define UintMaxTypePrintfFormat "0x%I64x"
+# else
+# if __WORDSIZE == 64
+# define UintMaxTypePrintfFormat "%#lx"
+# else
+# define UintMaxTypePrintfFormat "%#llx"
+# endif
+# endif /* _WIN32 */
+#endif /* UintMaxTypePrintfFormat */
+
+/* Printf format used to display uintmax_t as a decimal. */
+#ifndef UintMaxTypePrintfFormatDecimal
+# ifdef _WIN32
+# define UintMaxTypePrintfFormatDecimal "%I64u"
+# else
+# if __WORDSIZE == 64
+# define UintMaxTypePrintfFormatDecimal "%lu"
+# else
+# define UintMaxTypePrintfFormatDecimal "%llu"
+# endif
+# endif /* _WIN32 */
+#endif /* UintMaxTypePrintfFormat */
+
+#ifndef FloatPrintfFormat
+# define FloatPrintfFormat "%f"
+#endif /* FloatPrintfFormat */
+
+#ifndef DoublePrintfFormat
+# define DoublePrintfFormat "%f"
+#endif /* DoublePrintfFormat */
/*
* Declare and initialize a uintmax_t variable name