Get rid of _DEFAULT_SOURCE #defines, set this in cmake and also use

secure_getenv where it makes sense.
This commit is contained in:
Jari Vetoniemi 2015-01-17 18:52:21 +02:00
parent 6ac8d8c4d8
commit f76cfbca4f
10 changed files with 4 additions and 14 deletions

View File

@ -9,8 +9,8 @@ INCLUDE(CTest)
INCLUDE(GetGitRevisionDescription)
get_git_head_revision(GIT_REFSPEC GIT_SHA1)
# C99
ADD_DEFINITIONS(-std=c99)
# C99 and _GNU_SOURCE for secure_getenv
ADD_DEFINITIONS(-std=c99 -D_GNU_SOURCE)
# Compile library
ADD_SUBDIRECTORY(lib)

View File

@ -1,4 +1,3 @@
#define _DEFAULT_SOURCE
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

View File

@ -1,4 +1,3 @@
#define _DEFAULT_SOURCE
#include "common.h"
#include <stdlib.h>
#include <string.h>

View File

@ -123,12 +123,12 @@ bm_init(void)
return true;
static const char *rpath = INSTALL_PREFIX "/lib/bemenu";
const char *path = getenv("BEMENU_RENDERER");
const char *path = secure_getenv("BEMENU_RENDERER");
if (path)
return load_to_list(path);
path = getenv("BEMENU_RENDERERS");
path = secure_getenv("BEMENU_RENDERERS");
if (!path || access(path, R_OK) == -1)
path = rpath;

View File

@ -1,6 +1,3 @@
#define _DEFAULT_SOURCE
#define _XOPEN_SOURCE_EXTENDED
#include "internal.h"
#include "version.h"

View File

@ -1,4 +1,3 @@
#define _DEFAULT_SOURCE
#include "wayland.h"
#include <unistd.h>

View File

@ -1,4 +1,3 @@
#define _DEFAULT_SOURCE
#include "internal.h"
#include "version.h"
#include "wayland.h"

View File

@ -1,4 +1,3 @@
#define _DEFAULT_SOURCE
#include "internal.h"
#include "wayland.h"

View File

@ -1,4 +1,3 @@
#define _DEFAULT_SOURCE
#include "internal.h"
#include "version.h"
#include "x11.h"

View File

@ -1,4 +1,3 @@
#define _DEFAULT_SOURCE
#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>