aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--command.c2
-rw-r--r--db.c1
-rw-r--r--main.c1
-rw-r--r--user_data.c4
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 <stdlib.h>
#include <string.h>
#include <assert.h>
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 <stdio.h>
#include <stdlib.h>
#include <string.h>
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;i<item->data.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--;