]> git.ipfire.org Git - thirdparty/nettle.git/commitdiff
Added die function to testutils.c.
authorNiels Möller <nisse@lysator.liu.se>
Fri, 15 Feb 2013 15:29:26 +0000 (16:29 +0100)
committerNiels Möller <nisse@lysator.liu.se>
Fri, 15 Feb 2013 15:29:26 +0000 (16:29 +0100)
ChangeLog
testsuite/testutils.c
testsuite/testutils.h

index 79305a9ae82fc03ac2f452885110ae85edd7363c..38ef1645313cdeff60c30684d5b2fa7f4eb37e19 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2013-02-15  Niels Möller  <nisse@lysator.liu.se>
 
+       * testsuite/testutils.c: Removed redundant includes.
+       (die): New function.
+
        Integrate ecc_mul_g.
        * ecc.h: New file.
        * ecc-j-to-a.c: New file.
index 14d5df296f9441bd9c779d3a9d0d626fa1ca475c..dfe084e84565f06623c4d86dbccd3cdc0ac187b1 100644 (file)
@@ -10,9 +10,6 @@
 
 #include <assert.h>
 #include <ctype.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
 
 /* -1 means invalid */
 static const signed char hex_digits[0x100] =
@@ -35,6 +32,21 @@ static const signed char hex_digits[0x100] =
     -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
   };
 
+void
+die(const char *format, ...)
+{
+  va_list args;
+  va_start(args, format);
+#if WITH_HOGWEED
+  gmp_vfprintf(stderr, format, args);
+#else
+  vfprintf(stderr, format, args);
+#endif
+  va_end(args);
+
+  abort ();
+}
+
 void *
 xalloc(size_t size)
 {
index 14aa794daf382b3a0fa6ba1ae4037d568e6c4d9a..8b470697bea9836b71d4e81b74e5703577de8d44 100644 (file)
@@ -7,9 +7,10 @@
 
 #include "nettle-types.h"
 
-#include <string.h>
+#include <stdarg.h>
 #include <stdlib.h>
 #include <stdio.h>
+#include <string.h>
 
 #if HAVE_LIBGMP
 # include "bignum.h"
@@ -33,6 +34,9 @@ struct nettle_aead;
 extern "C" {
 #endif
 
+void
+die(const char *format, ...) PRINTF_STYLE (1, 2) NORETURN;
+
 void *
 xalloc(size_t size);