use -std=c11

master
Alessandro Mauri 3 years ago
parent 112d3fd03b
commit b74571e500
  1. 2
      TODO
  2. 2
      makefile
  3. 10
      src/api/system.c
  4. 6
      src/main.c

@ -1,5 +1,5 @@
[x] use system lua lib [x] use system lua lib
[ ] make it std=c11 not gnu11 [x] make it std=c11 not gnu11
[ ] make it compile on openbsd [ ] make it compile on openbsd
[ ] update license, readme and documentation [ ] update license, readme and documentation
[ ] add manpage [ ] add manpage

@ -4,7 +4,7 @@ PREFIX = /usr/local
MANPREFIX = ${PREFIX}/share/man MANPREFIX = ${PREFIX}/share/man
CC ?= gcc CC ?= gcc
SRCDIR = ./src SRCDIR = ./src
CFLAGS = -Wall -Werror -pedantic -O3 -std=gnu11 -fno-strict-aliasing \ CFLAGS = -Wall -Werror -pedantic -O3 -std=c11 -fno-strict-aliasing \
-I${SRCDIR} -DLUA_USE_POSIX -I${SRCDIR} -DLUA_USE_POSIX
# remove this # remove this
LDFLAGS = -lSDL2 -lm -llua5.2 LDFLAGS = -lSDL2 -lm -llua5.2

@ -1,10 +1,16 @@
#include <SDL2/SDL.h> #define _XOPEN_SOURCE 700
#include <sys/stat.h>
#include <stdbool.h> #include <stdbool.h>
#include <ctype.h> #include <ctype.h>
#include <dirent.h> #include <dirent.h>
#include <unistd.h> #include <unistd.h>
#include <errno.h> #include <errno.h>
#include <sys/stat.h> #include <limits.h>
#include <stdlib.h>
#include <SDL2/SDL.h>
#include "api.h" #include "api.h"
#include "rencache.h" #include "rencache.h"

@ -1,3 +1,5 @@
#define _POSIX_C_SOURCE 200809l
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>
#include <SDL2/SDL.h> #include <SDL2/SDL.h>
@ -5,10 +7,8 @@
#include "api/api.h" #include "api/api.h"
#include "renderer.h" #include "renderer.h"
SDL_Window *window; SDL_Window *window;
static double get_scale(void) static double get_scale(void)
{ {
float dpi; float dpi;
@ -16,7 +16,6 @@ static double get_scale(void)
return 1.0; return 1.0;
} }
static void get_exe_filename(char *buf, int sz) static void get_exe_filename(char *buf, int sz)
{ {
char path[512]; char path[512];
@ -25,7 +24,6 @@ static void get_exe_filename(char *buf, int sz)
buf[len] = '\0'; buf[len] = '\0';
} }
static void init_window_icon(void) static void init_window_icon(void)
{ {
// FIXME: include inside function!? // FIXME: include inside function!?

Loading…
Cancel
Save