Get rid of GNU_SOURCE (issue #625)
o9000 mrovi9000@gmail.com
5 files changed,
13 insertions(+),
10 deletions(-)
M
CMakeLists.txt
→
CMakeLists.txt
@@ -82,7 +82,7 @@ if( NOT IMLIB_BUILD_WITH_X )
message( FATAL_ERROR "Imlib is not built with X support" ) endif( NOT IMLIB_BUILD_WITH_X ) -add_definitions( -D_GNU_SOURCE ) +add_definitions( -D_POSIX_C_SOURCE=200809L -D_BSD_SOURCE ) include_directories( ${PROJECT_BINARY_DIR} src
M
src/separator/separator.c
→
src/separator/separator.c
@@ -188,6 +188,7 @@ }
void draw_separator_dots(void *obj, cairo_t *c) { + const double PI = 3.14159265359; Separator *separator = (Separator *)obj; if (separator->thickness <= 0) return;@@ -214,14 +215,14 @@ separator->area.width / 2.0,
offset + separator->thickness / 2.0, separator->thickness / 2.0, 0, - 2 * M_PI); + 2 * PI); } else { cairo_arc(c, offset + separator->thickness / 2.0, separator->area.height / 2.0, separator->thickness / 2.0, 0, - 2 * M_PI); + 2 * PI); } cairo_stroke_preserve(c); cairo_fill(c);
M
src/server.c
→
src/server.c
@@ -256,7 +256,7 @@ XGCValues gcv;
gcv.ts_x_origin = 0; gcv.ts_y_origin = 0; gcv.fill_style = FillTiled; - uint mask = GCTileStipXOrigin | GCTileStipYOrigin | GCFillStyle | GCTile; + unsigned mask = GCTileStipXOrigin | GCTileStipYOrigin | GCFillStyle | GCTile; gcv.tile = server.root_pmap; XChangeGC(server.display, server.gc, mask, &gcv);
M
src/taskbar/task.c
→
src/taskbar/task.c
@@ -301,8 +301,8 @@ if (hints->flags & IconPixmapHint && hints->icon_pixmap != 0) {
// get width, height and depth for the pixmap Window root; int icon_x, icon_y; - uint border_width, bpp; - uint w, h; + unsigned border_width, bpp; + unsigned w, h; XGetGeometry(server.display, hints->icon_pixmap, &root, &icon_x, &icon_y, &w, &h, &border_width, &bpp); imlib_context_set_drawable(hints->icon_pixmap);
M
src/util/common.c
→
src/util/common.c
@@ -449,9 +449,9 @@ image = imlib_load_image_immediately_without_cache(path);
} if (!image && g_str_has_suffix(path, ".svg")) { char tmp_filename[128]; - sprintf(tmp_filename, "/tmp/tint2-%d-XXXXXX.png", (int)getpid()); - int fd = mkstemps(tmp_filename, 4); - if (fd) { + sprintf(tmp_filename, "/tmp/tint2-%d.png", (int)getpid()); + int fd = open(tmp_filename, O_CREAT | O_EXCL, 0600); + if (fd >= 0) { // We fork here because librsvg allocates memory like crazy pid_t pid = fork(); if (pid == 0) {@@ -469,6 +469,7 @@ }
exit(0); } else { // Parent + close(fd); waitpid(pid, 0, 0); image = imlib_load_image_immediately_without_cache(tmp_filename); unlink(tmp_filename);@@ -639,7 +640,8 @@ char *value = getenv(var);
if (value) { value = strdup(value); char *p = value; - for (char *token = strsep(&value, ":"); token; token = strsep(&value, ":")) { + char *t; + for (char *token = strtok_r(value, ":", &t); token; token = strtok_r(NULL, ":", &t)) { va_list ap; va_start(ap, var); for (const char *suffix = va_arg(ap, const char *); suffix; suffix = va_arg(ap, const char *)) {