util, io, net, ...: use "#pragma once"

This commit is contained in:
Max Kellermann
2024-02-26 13:01:12 +01:00
committed by Max Kellermann
parent 313f2a1894
commit be84b189dc
32 changed files with 32 additions and 128 deletions

View File

@@ -1,8 +1,7 @@
// SPDX-License-Identifier: BSD-2-Clause
// author: Max Kellermann <max.kellermann@gmail.com>
#ifndef BUFFERED_OUTPUT_STREAM_HXX
#define BUFFERED_OUTPUT_STREAM_HXX
#pragma once
#include "util/DynamicFifoBuffer.hxx"
#include "util/SpanCast.hxx"
@@ -130,5 +129,3 @@ WithBufferedOutputStream(OutputStream &os, F &&f)
f(bos);
bos.Flush();
}
#endif

View File

@@ -1,8 +1,7 @@
// SPDX-License-Identifier: BSD-2-Clause
// author: Max Kellermann <max.kellermann@gmail.com>
#ifndef OPEN_HXX
#define OPEN_HXX
#pragma once
class FileDescriptor;
class UniqueFileDescriptor;
@@ -38,5 +37,3 @@ UniqueFileDescriptor
OpenDirectory(FileDescriptor directory, const char *name, int flags=0);
#endif
#endif

View File

@@ -1,8 +1,7 @@
// SPDX-License-Identifier: BSD-2-Clause
// author: Max Kellermann <max.kellermann@gmail.com>
#ifndef OUTPUT_STREAM_HXX
#define OUTPUT_STREAM_HXX
#pragma once
#include <cstddef>
#include <span>
@@ -17,5 +16,3 @@ public:
*/
virtual void Write(std::span<const std::byte> src) = 0;
};
#endif

View File

@@ -1,8 +1,7 @@
// SPDX-License-Identifier: BSD-2-Clause
// author: Max Kellermann <max.kellermann@gmail.com>
#ifndef READER_HXX
#define READER_HXX
#pragma once
#include <cstddef>
#include <span>
@@ -41,5 +40,3 @@ public:
ReadFull(std::as_writable_bytes(std::span{&dest, 1}));
}
};
#endif

View File

@@ -1,8 +1,7 @@
// SPDX-License-Identifier: BSD-2-Clause
// author: Max Kellermann <max.kellermann@gmail.com>
#ifndef STDIO_OUTPUT_STREAM_HXX
#define STDIO_OUTPUT_STREAM_HXX
#pragma once
#include "OutputStream.hxx"
@@ -21,5 +20,3 @@ public:
/* this class is debug-only and ignores errors */
}
};
#endif

View File

@@ -1,8 +1,7 @@
// SPDX-License-Identifier: BSD-2-Clause
// author: Max Kellermann <max.kellermann@gmail.com>
#ifndef UNIQUE_FILE_DESCRIPTOR_HXX
#define UNIQUE_FILE_DESCRIPTOR_HXX
#pragma once
#include "FileDescriptor.hxx" // IWYU pragma: export
@@ -72,5 +71,3 @@ public:
return IsDefined() && FileDescriptor::Close();
}
};
#endif