From 8ac173549537c25654012419f0f66a351c65f8cf Mon Sep 17 00:00:00 2001 From: tomsmeding Date: Fri, 17 Mar 2017 18:21:11 +0100 Subject: Compile on linux --- command.c | 2 +- db.c | 1 + main.c | 1 + user_data.c | 4 ++-- 4 files changed, 5 insertions(+), 3 deletions(-) diff --git a/command.c b/command.c index 431c8f1..f5ad077 100644 --- a/command.c +++ b/command.c @@ -60,7 +60,7 @@ static bool send_name(int fd,const char *tag,const char *name){ static bool send_list(int fd,const char *tag,i64 count,const char **list){ char *buf=NULL; - i64 len=asprintf(&buf,"%s list %lld",tag,count); + i64 len=asprintf(&buf,"%s list %" PRIi64,tag,count); assert(buf); bool closed=send_raw_text(fd,buf,len); free(buf); diff --git a/db.c b/db.c index 80f9867..f89e628 100644 --- a/db.c +++ b/db.c @@ -1,3 +1,4 @@ +#define _GNU_SOURCE #include #include #include diff --git a/main.c b/main.c index d9fafb4..aa0fdc5 100644 --- a/main.c +++ b/main.c @@ -1,3 +1,4 @@ +#define _GNU_SOURCE #include #include #include diff --git a/user_data.c b/user_data.c index 65587ad..26e573a 100644 --- a/user_data.c +++ b/user_data.c @@ -30,7 +30,7 @@ void userdata_register(i64 userid,int fd){ if(item){ for(i64 i=0;idata.fds_len;i++){ if(item->data.fds[i]==fd){ - die("userdata_register(%lld, %d) while pair already existed",userid,fd); + die("userdata_register(%" PRIi64 ", %d) while pair already existed",userid,fd); } } if(item->data.fds_len==item->data.fds_cap){ @@ -58,7 +58,7 @@ void userdata_unregister(i64 userid,int fd){ if(item->data.fds[i]==fd)break; } if(i==item->data.fds_len){ - die("userdata_unregister(%lld, %d) while nonexistent",userid,fd); + die("userdata_unregister(%" PRIi64 ", %d) while nonexistent",userid,fd); } memmove(item->data.fds+i,item->data.fds+i+1,item->data.fds_len-i-1); item->data.fds_len--; -- cgit v1.2.3-70-g09d2