src: include primary header first

This is a common practice in C projects, which simply enforces that
each header must compile cleanly without implicit dependencies on
other headers (see also the previous commit).
This commit is contained in:
John Lindgren 2025-07-28 01:02:01 -04:00 committed by Johan Malm
parent c9b576982d
commit 31d42b50e2
74 changed files with 74 additions and 72 deletions

View file

@ -3,6 +3,7 @@
* Copyright (C) Johan Malm 2023
*/
#define _POSIX_C_SOURCE 200809L
#include "img/img-png.h"
#include <assert.h>
#include <cairo.h>
#include <png.h>
@ -12,7 +13,6 @@
#include <wlr/util/log.h>
#include "buffer.h"
#include "common/string-helpers.h"
#include "img/img-png.h"
/*
* cairo_image_surface_create_from_png() does not gracefully handle non-png

View file

@ -3,6 +3,7 @@
* Copyright (C) Johan Malm 2023
*/
#define _POSIX_C_SOURCE 200809L
#include "img/img-svg.h"
#include <cairo.h>
#include <librsvg/rsvg.h>
#include <stdbool.h>
@ -11,7 +12,6 @@
#include <wlr/util/log.h>
#include "buffer.h"
#include "common/string-helpers.h"
#include "img/img-svg.h"
#include "labwc.h"
RsvgHandle *

View file

@ -6,6 +6,7 @@
*/
#define _POSIX_C_SOURCE 200809L
#include "img/img-xbm.h"
#include <assert.h>
#include <stdbool.h>
#include <stdint.h>
@ -14,7 +15,6 @@
#include <string.h>
#include <drm_fourcc.h>
#include "img/img.h"
#include "img/img-xbm.h"
#include "common/grab-file.h"
#include "common/mem.h"
#include "common/string-helpers.h"

View file

@ -11,6 +11,7 @@
* Adapted for labwc by John Lindgren, 2024
*/
#include "img/img-xpm.h"
#include <glib.h>
#include <stdio.h>
#include <stdlib.h>
@ -21,7 +22,6 @@
#include "common/buf.h"
#include "common/graphic-helpers.h"
#include "common/mem.h"
#include "img/img-xpm.h"
enum buf_op { op_header, op_cmap, op_body };

View file

@ -1,5 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
#include "img/img.h"
#include <assert.h>
#include <wlr/util/log.h>
#include "buffer.h"
@ -9,7 +10,6 @@
#include "common/macros.h"
#include "common/mem.h"
#include "common/string-helpers.h"
#include "img/img.h"
#include "img/img-png.h"
#if HAVE_RSVG
#include "img/img-svg.h"