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
[ ] make it std=c11 not gnu11
[x] make it std=c11 not gnu11
[ ] make it compile on openbsd
[ ] update license, readme and documentation
[ ] add manpage

@ -4,7 +4,7 @@ PREFIX = /usr/local
MANPREFIX = ${PREFIX}/share/man
CC ?= gcc
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
# remove this
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 <ctype.h>
#include <dirent.h>
#include <unistd.h>
#include <errno.h>
#include <sys/stat.h>
#include <limits.h>
#include <stdlib.h>
#include <SDL2/SDL.h>
#include "api.h"
#include "rencache.h"

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

Loading…
Cancel
Save