Skip to content

Commit

Permalink
Bugfix: example: Deal with build and portability issues
Browse files Browse the repository at this point in the history
  • Loading branch information
luke-jr committed Aug 13, 2016
1 parent 2d822c6 commit 130cfbd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Makefile.am
Expand Up @@ -54,10 +54,10 @@ dist_noinst_DATA = \
if CAN_COMPILE_EXAMPLE
EXTRA_PROGRAMS = example
example_SOURCES = example.c
example_LDADD = libblkmaker-$(LIBBLKMAKER_API_VERSION).la libblkmaker_jansson-$(LIBBLKMAKER_API_VERSION).la $(LIBGCRYPT_LIBS)
example_CFLAGS = $(LIBGCRYPT_CFLAGS)
example_CFLAGS = $(libbase58_CFLAGS) $(JANSSON_CFLAGS) $(LIBGCRYPT_CFLAGS)
example_LDADD = $(libbase58_LIBS) libblkmaker-@LIBBLKMAKER_API_VERSION@.la libblkmaker_jansson-@LIBBLKMAKER_API_VERSION@.la $(JANSSON_LIBS) $(LIBGCRYPT_LIBS)
else
example:
@echo "libgcrypt is required to build the example, but was not found"
@echo "libgcrypt is required to build the example, but was not found"
.PHONY: example
endif
5 changes: 5 additions & 0 deletions example.c
Expand Up @@ -9,7 +9,11 @@
#include <inttypes.h>
#include <stdint.h>

#ifndef WIN32
#include <arpa/inet.h>
#else
#include <winsock2.h>
#endif

#include <gcrypt.h>
#include <libbase58.h>
Expand Down Expand Up @@ -127,4 +131,5 @@ int main(int argc, char**argv) {
send_json(req);
}
blktmpl_free(tmpl);
return 0;
}

0 comments on commit 130cfbd

Please sign in to comment.