Ensure all *.[ch] files include config.h

Including config.h is necessary to get e.g. the _GNU_SOURCE define and
any other definitions that autoconf declares. Hence, config.h needs to
be included as the first header in each file.

This is done either via:
1. Including "common.h" (i3bar)
2. Including "libi3.h"
3. Including "all.h" (i3)
4. Including <config.h> directly

Also remove now-unused I3__FILE__, add copyright/license statement
where missing and switch include/all.h to #pragma once.
This commit is contained in:
Michael Stapelberg
2016-10-11 09:13:35 +02:00
parent c2bd10c482
commit f354f53435
134 changed files with 230 additions and 149 deletions

View File

@ -1,5 +1,3 @@
#undef I3__FILE__
#define I3__FILE__ "commands_parser.c"
/*
* vim:ts=4:sw=4:expandtab
*
@ -25,6 +23,8 @@
* instead of actually calling any function).
*
*/
#include "all.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -32,8 +32,6 @@
#include <stdbool.h>
#include <stdint.h>
#include "all.h"
// Macros to make the YAJL API a bit easier to use.
#define y(x, ...) (command_output.json_gen != NULL ? yajl_gen_##x(command_output.json_gen, ##__VA_ARGS__) : 0)
#define ystr(str) (command_output.json_gen != NULL ? yajl_gen_string(command_output.json_gen, (unsigned char *)str, strlen(str)) : 0)