Add common.c

This commit is contained in:
angt
2015-11-16 16:00:33 +01:00
parent a8ebefbef3
commit 21ae1f34c3
4 changed files with 11 additions and 5 deletions

View File

@@ -4,6 +4,7 @@ glorytun_LDADD = $(libsodium_LIBS)
glorytun_SOURCES = \
src/common.h \
src/common-static.h \
src/common.c \
src/ip-static.h \
src/main.c \
src/option.c \

8
src/common.c Normal file
View File

@@ -0,0 +1,8 @@
#include "common.h"
#include <stdio.h>
void gt_not_available (const char *name)
{
fprintf(stderr, "%s is not available on your platform!\n", name);
}

View File

@@ -24,3 +24,5 @@ struct buffer {
uint8_t *write;
uint8_t *end;
};
void gt_not_available (const char *);

View File

@@ -43,11 +43,6 @@ struct crypto_ctx {
volatile sig_atomic_t running;
static void gt_not_available (const char *name)
{
fprintf(stderr, "%s is not available on your platform!\n", name);
}
static int64_t dt_ms (struct timeval *ta, struct timeval *tb)
{
const int64_t s = ta->tv_sec-tb->tv_sec;