refactor: replace manual header guards with #pragma once

It is less error-prone than manually defining header guards. Pretty much
all compilers support it even if it's not part of the C standard.
This commit is contained in:
dundargoc
2023-11-10 12:23:42 +01:00
committed by dundargoc
parent 353a4be7e8
commit 4f8941c1a5
220 changed files with 227 additions and 998 deletions

View File

@@ -1,5 +1,4 @@
#ifndef NVIM_EVENT_DEFS_H
#define NVIM_EVENT_DEFS_H
#pragma once
#include <assert.h>
#include <stdarg.h>
@@ -34,5 +33,3 @@ static inline Event event_create(argv_callback cb, int argc, ...)
VA_EVENT_INIT(&event, cb, argc);
return event;
}
#endif // NVIM_EVENT_DEFS_H

View File

@@ -1,5 +1,4 @@
#ifndef NVIM_EVENT_LIBUV_PROCESS_H
#define NVIM_EVENT_LIBUV_PROCESS_H
#pragma once
#include <uv.h>
@@ -24,4 +23,3 @@ static inline LibuvProcess libuv_process_init(Loop *loop, void *data)
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "event/libuv_process.h.generated.h"
#endif
#endif // NVIM_EVENT_LIBUV_PROCESS_H

View File

@@ -1,5 +1,4 @@
#ifndef NVIM_EVENT_LOOP_H
#define NVIM_EVENT_LOOP_H
#pragma once
#include <stdint.h>
#include <uv.h>
@@ -85,5 +84,3 @@ typedef struct loop {
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "event/loop.h.generated.h"
#endif
#endif // NVIM_EVENT_LOOP_H

View File

@@ -1,5 +1,4 @@
#ifndef NVIM_EVENT_MULTIQUEUE_H
#define NVIM_EVENT_MULTIQUEUE_H
#pragma once
#include <uv.h>
@@ -15,4 +14,3 @@ typedef void (*PutCallback)(MultiQueue *multiq, void *data);
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "event/multiqueue.h.generated.h"
#endif
#endif // NVIM_EVENT_MULTIQUEUE_H

View File

@@ -1,5 +1,4 @@
#ifndef NVIM_EVENT_PROCESS_H
#define NVIM_EVENT_PROCESS_H
#pragma once
#include <stdbool.h>
#include <stddef.h>
@@ -83,4 +82,3 @@ static inline bool process_is_stopped(Process *proc)
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "event/process.h.generated.h"
#endif
#endif // NVIM_EVENT_PROCESS_H

View File

@@ -1,5 +1,4 @@
#ifndef NVIM_EVENT_RSTREAM_H
#define NVIM_EVENT_RSTREAM_H
#pragma once
#include <stdbool.h>
#include <stddef.h>
@@ -11,4 +10,3 @@
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "event/rstream.h.generated.h"
#endif
#endif // NVIM_EVENT_RSTREAM_H

View File

@@ -1,5 +1,4 @@
#ifndef NVIM_EVENT_SIGNAL_H
#define NVIM_EVENT_SIGNAL_H
#pragma once
#include <uv.h>
@@ -23,4 +22,3 @@ struct signal_watcher {
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "event/signal.h.generated.h"
#endif
#endif // NVIM_EVENT_SIGNAL_H

View File

@@ -1,5 +1,4 @@
#ifndef NVIM_EVENT_SOCKET_H
#define NVIM_EVENT_SOCKET_H
#pragma once
#include <uv.h>
@@ -39,4 +38,3 @@ struct socket_watcher {
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "event/socket.h.generated.h"
#endif
#endif // NVIM_EVENT_SOCKET_H

View File

@@ -1,5 +1,4 @@
#ifndef NVIM_EVENT_STREAM_H
#define NVIM_EVENT_STREAM_H
#pragma once
#include <stdbool.h>
#include <stddef.h>
@@ -61,4 +60,3 @@ struct stream {
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "event/stream.h.generated.h"
#endif
#endif // NVIM_EVENT_STREAM_H

View File

@@ -1,5 +1,4 @@
#ifndef NVIM_EVENT_TIME_H
#define NVIM_EVENT_TIME_H
#pragma once
#include <stdbool.h>
#include <uv.h>
@@ -23,4 +22,3 @@ struct time_watcher {
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "event/time.h.generated.h"
#endif
#endif // NVIM_EVENT_TIME_H

View File

@@ -1,5 +1,4 @@
#ifndef NVIM_EVENT_WSTREAM_H
#define NVIM_EVENT_WSTREAM_H
#pragma once
#include <stdbool.h>
#include <stddef.h>
@@ -23,4 +22,3 @@ struct wbuffer {
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "event/wstream.h.generated.h"
#endif
#endif // NVIM_EVENT_WSTREAM_H