Skip to content

Commit

Permalink
Build didn't work if libsodium wasn't installed
Browse files Browse the repository at this point in the history
  • Loading branch information
hintjens committed Sep 13, 2013
1 parent 3298e5a commit 0db2bbe
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tools/curve_keygen.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,16 @@
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <sodium.h>
#include "z85_codec.h"
#include "../src/platform.hpp"

#ifdef HAVE_LIBSODIUM
# include <sodium.h>
# include "z85_codec.h"
#endif

int main (void)
{
#ifdef HAVE_LIBSODIUM
# if crypto_box_PUBLICKEYBYTES != 32 \
|| crypto_box_SECRETKEYBYTES != 32
# error "libsodium not built correctly"
Expand Down Expand Up @@ -59,5 +64,8 @@ int main (void)
puts ("\n== CURVE SECRET KEY ==");
puts (encoded);

#else
puts ("To build curve_keygen, please install libsodium and then rebuild libzmq.");
#endif
exit (0);
}

0 comments on commit 0db2bbe

Please sign in to comment.