Mercurial > backlight
changeset 11:637ef49be6c9
backlight: use _XOPEN_SOURCE=700
author | David Demelier <markand@malikania.fr> |
---|---|
date | Fri, 20 Sep 2019 10:14:24 +0200 |
parents | 2b12d8bee90d |
children | 6621c6f2b7e2 |
files | Makefile backlight.c |
diffstat | 2 files changed, 7 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/Makefile Fri Sep 20 07:19:30 2019 +0200 +++ b/Makefile Fri Sep 20 10:14:24 2019 +0200 @@ -17,7 +17,8 @@ # CC= gcc -CFLAGS= -Wall -Wextra -pedantic -std=c99 -DNDEBUG ${EXTRA_CFLAGS} +CFLAGS= -Wall -Wextra -pedantic -std=c99 ${EXTRA_CFLAGS} +CPPFLAGS= -DNDEBUG -D_XOPEN_SOURCE=700 LDFLAGS= ${EXTRA_LDFLAGS} LDLIBS= ${EXTRA_LDLIBS} @@ -34,7 +35,7 @@ all: ${PROG} .c.o: - ${CC} ${CFLAGS} -c -o $@ $< + ${CC} ${CPPFLAGS} ${CFLAGS} -c -o $@ $< ${PROG}: ${OBJS} ${CC} -o ${PROG} ${OBJS} ${LDFLAGS} ${LDLIBS}
--- a/backlight.c Fri Sep 20 07:19:30 2019 +0200 +++ b/backlight.c Fri Sep 20 10:14:24 2019 +0200 @@ -16,8 +16,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#define _POSIX_C_SOURCE 200809L - #include <errno.h> #include <stdarg.h> #include <stdio.h> @@ -113,8 +111,8 @@ #include <sys/types.h> #include <sys/stat.h> +#include <dirent.h> #include <fcntl.h> -#include <dirent.h> #include <unistd.h> #define SYS_PATH "/sys/class/backlight" @@ -232,6 +230,8 @@ (void)type; die("backlight is not supported on this system"); + + return -1; } #endif @@ -244,7 +244,7 @@ int st, type = None; if (argc < 2) - usage(argv[0]); + usage("backlight"); if (strcmp(argv[1], "up") == 0) type = Up;