Remove commented-out C-only macro features

This commit is contained in:
Rangi42
2024-03-02 20:17:22 -05:00
parent 52f8ecc347
commit 2e1b0b6421
8 changed files with 23 additions and 37 deletions

View File

@@ -11,9 +11,7 @@
#include "asm/section.hpp"
#include "platform.hpp" // MIN_NB_ELMS
#define MAXSYMLEN 255
#define MAXSYMLEN 255
enum SymbolType {
SYM_LABEL,
@@ -72,7 +70,7 @@ void sym_SetExportAll(bool set);
Symbol *sym_AddLocalLabel(char const *symName);
Symbol *sym_AddLabel(char const *symName);
Symbol *sym_AddAnonLabel();
void sym_WriteAnonLabelName(char buf[MIN_NB_ELMS(MAXSYMLEN + 1)], uint32_t ofs, bool neg);
void sym_WriteAnonLabelName(char buf[/* MAXSYMLEN + 1 */], uint32_t ofs, bool neg);
void sym_Export(char const *symName);
Symbol *sym_AddEqu(char const *symName, int32_t value);
Symbol *sym_RedefEqu(char const *symName, int32_t value);

View File

@@ -8,11 +8,11 @@
extern "C" {
void warn(char const NONNULL(fmt), ...) format_(printf, 1, 2);
void warnx(char const NONNULL(fmt), ...) format_(printf, 1, 2);
void warn(char const *fmt ...) format_(printf, 1, 2);
void warnx(char const *fmt, ...) format_(printf, 1, 2);
[[noreturn]] void err(char const NONNULL(fmt), ...) format_(printf, 1, 2);
[[noreturn]] void errx(char const NONNULL(fmt), ...) format_(printf, 1, 2);
[[noreturn]] void err(char const *fmt, ...) format_(printf, 1, 2);
[[noreturn]] void errx(char const *fmt, ...) format_(printf, 1, 2);
}

View File

@@ -45,12 +45,6 @@
# include <unistd.h>
#endif
// C++ doesn't support `[static N]` for array arguments from C99 or C11
#define MIN_NB_ELMS(N) // static (N)
#define ARR_QUALS(...) // __VA_ARGS__
#define NONNULL(ptr) *ptr // ptr[static 1]
#define restrict
// MSVC uses a different name for O_RDWR, and needs an additional _O_BINARY flag
#ifdef _MSC_VER
# include <fcntl.h>