Skip to content

Commit acc0599

Browse files
committed
Fully support std::format and std::print
1 parent 96f153d commit acc0599

File tree

8 files changed

+126
-113
lines changed

8 files changed

+126
-113
lines changed

docs/BUILDING.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,10 @@ The Windows version uses C++23, and the Unix versions use either C++20 or C++23
2020

2121
### fmt library
2222

23-
The features that rsgain uses from the fmt library have been integrated into the C++20 and C++23 standards, specifically the `<format>` and `<print>` headers. Currently, neither GCC nor Clang have full support those features, so the fmt libary is required. When they gain support, the fmt dependency will be dropped in favor of the C++ standard library.
24-
25-
The features have been incorporated into Microsoft's C++ standard library implementation, so the fmt library is no longer required for the Windows version.
23+
The features that rsgain uses from the fmt library have been integrated into the C++20 and C++23 standards, specifically the `<format>` and `<print>` headers. The standard library implementations are planned to completely replace rsgain's fmt dependency in the future. To support the transition, rsgain can use either the fmt library or standard library, depending on platform:
24+
- MSVC has full support in the standard library since version 19.37. The fmt library has been dropped from the Windows version in favor of the standard library implementation
25+
- GCC (libstdc++) has full support in the standard library since version 14. Pass `-DUSE_STD_FORMAT=ON` to `cmake` to use the standard library instead of the fmt library
26+
- Clang (libc++) has full support in the standard library since version 18. Enable it using the configuration switch described above for GCC
2627

2728
## Unix
2829

src/easymode.cpp

+22-22
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include "scan.hpp"
2828

2929
#define MAX_THREAD_SLEEP 30
30-
#define HELP_STATS(title, format, ...) print(COLOR_YELLOW "{:<18} " COLOR_OFF format "\n", title ":" __VA_OPT__(,) __VA_ARGS__)
30+
#define HELP_STATS(title, format, ...) rsgain::print(COLOR_YELLOW "{:<18} " COLOR_OFF format "\n", title ":" __VA_OPT__(,) __VA_ARGS__)
3131

3232
extern "C" {
3333
int format_handler(void *user, const char *section, const char *name, const char *value);
@@ -776,7 +776,7 @@ void scan_easy(const std::filesystem::path &path, const std::filesystem::path &p
776776
break;
777777
cv.wait_for(lock, std::chrono::milliseconds(200));
778778
}
779-
print("\33[2K\n");
779+
rsgain::print("\33[2K\n");
780780
}
781781

782782
// Single threaded scanning
@@ -787,69 +787,69 @@ void scan_easy(const std::filesystem::path &path, const std::filesystem::path &p
787787
job->update_data(data);
788788
jobs.pop();
789789
}
790-
print("\n");
790+
rsgain::print("\n");
791791
}
792792

793793
// Output statistics at the end
794794
auto duration = std::chrono::floor<std::chrono::seconds>(std::chrono::system_clock::now() - start_time);
795795
if (!data.files) {
796796
if (data.skipped)
797-
print("Skipped {:L} file{} with existing ReplayGain information\n",
797+
rsgain::print("Skipped {:L} file{} with existing ReplayGain information\n",
798798
data.skipped,
799799
data.skipped > 1 ? "s" : ""
800800
);
801-
print("No files were scanned\n");
801+
rsgain::print("No files were scanned\n");
802802
return;
803803
}
804804

805-
print(COLOR_GREEN "Scanning Complete" COLOR_OFF "\n");
805+
rsgain::print(COLOR_GREEN "Scanning Complete" COLOR_OFF "\n");
806806
HELP_STATS("Time Elapsed", "{:%H:%M:%S}", duration);
807807
HELP_STATS("Files Scanned", "{:L}", data.files);
808808
if (data.skipped)
809809
HELP_STATS("Files Skipped", "{:L}", data.skipped);
810810
HELP_STATS("Clip Adjustments", "{:L} ({:.1f}% of files)", data.clipping_adjustments, 100.f * (float) data.clipping_adjustments / (float) data.files);
811811
HELP_STATS("Average Gain", "{:.2f} dB", data.total_gain / (double) data.files);
812812
double average_peak = data.total_peak / (double) data.files;
813-
HELP_STATS("Average Peak", "{:.6f}{}", average_peak, average_peak != 0.0 ? format(" ({:.2f} dB)", 20.0 * log10(average_peak)) : "");
813+
HELP_STATS("Average Peak", "{:.6f}{}", average_peak, average_peak != 0.0 ? rsgain::format(" ({:.2f} dB)", 20.0 * log10(average_peak)) : "");
814814
HELP_STATS("Negative Gains", "{:L} ({:.1f}% of files)", data.total_negative, 100.f * (float) data.total_negative / (float) data.files);
815815
HELP_STATS("Positive Gains", "{:L} ({:.1f}% of files)", data.total_positive, 100.f * (float) data.total_positive / (float) data.files);
816-
print("\n");
816+
rsgain::print("\n");
817817

818818
// Inform user of errors
819819
if (!data.error_directories.empty()) {
820-
print(COLOR_RED "There were errors while scanning the following directories:" COLOR_OFF "\n");
820+
rsgain::print(COLOR_RED "There were errors while scanning the following directories:" COLOR_OFF "\n");
821821
for (const std::string &s : data.error_directories)
822-
print("{}\n", s);
823-
print("\n");
822+
rsgain::print("{}\n", s);
823+
rsgain::print("\n");
824824
}
825825
}
826826

827827
static inline void help_easy() {
828-
print(COLOR_RED "Usage: " COLOR_OFF "{}{}{} easy [OPTIONS] DIRECTORY\n", COLOR_GREEN, EXECUTABLE_TITLE, COLOR_OFF);
828+
rsgain::print(COLOR_RED "Usage: " COLOR_OFF "{}{}{} easy [OPTIONS] DIRECTORY\n", COLOR_GREEN, EXECUTABLE_TITLE, COLOR_OFF);
829829

830-
print(" Easy Mode recursively scans a directory using the recommended settings for each\n");
831-
print(" file type. Easy Mode assumes that you have your music library organized with each album\n");
832-
print(" in its own folder.\n");
830+
rsgain::print(" Easy Mode recursively scans a directory using the recommended settings for each\n");
831+
rsgain::print(" file type. Easy Mode assumes that you have your music library organized with each album\n");
832+
rsgain::print(" in its own folder.\n");
833833

834-
print("\n");
835-
print(COLOR_RED "Options:\n" COLOR_OFF);
834+
rsgain::print("\n");
835+
rsgain::print(COLOR_RED "Options:\n" COLOR_OFF);
836836

837837
CMD_HELP("--help", "-h", "Show this help");
838838
CMD_HELP("--quiet", "-q", "Don't print scanning status messages");
839-
print("\n");
839+
rsgain::print("\n");
840840

841841
CMD_HELP("--skip-existing", "-S", "Don't scan files with existing ReplayGain information");
842842
CMD_HELP("--multithread=n", "-m n", "Scan files with n parallel threads");
843843
CMD_HELP("--preset=s", "-p s", "Load scan preset s");
844844

845-
print("\n");
845+
rsgain::print("\n");
846846

847847
CMD_HELP("--output", "-O", "Output tab-delimited scan data to CSV file per directory");
848848
CMD_HELP("--output=s", "-O s", "Output with sep header (needed for Microsoft Excel compatibility)");
849849
CMD_HELP("--output=a", "-O a", "Output with files sorted in alphanumeric order");
850850

851-
print("\n");
851+
rsgain::print("\n");
852852

853-
print("Please report any issues to " PROJECT_URL "/issues\n");
854-
print("\n");
853+
rsgain::print("Please report any issues to " PROJECT_URL "/issues\n");
854+
rsgain::print("\n");
855855
}

src/output.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ void ProgressBar::update(int pos)
9191

9292
// Only output if we've actually made progress since last the call, or the console width changed
9393
if (c != c_prev || w != w_prev) {
94-
print(" {:3.0f}% [", percent * 100.f);
94+
rsgain::print(" {:3.0f}% [", percent * 100.f);
9595
memset(buffer, '=', (size_t) c);
9696
memset(buffer + c, ' ', (size_t) (w - c));
9797
buffer[w] = ']';
@@ -117,7 +117,7 @@ void ProgressBar::complete()
117117

118118
delete buffer;
119119
buffer = nullptr;
120-
print("\n");
120+
rsgain::print("\n");
121121
}
122122

123123
inline int ProgressBar::get_console_width()
@@ -144,7 +144,7 @@ void MTProgress::update(const std::string &path)
144144
if (w_path + w_message >= w_console)
145145
w_path = w_console - w_message;
146146

147-
print("\33[2K " COLOR_GREEN "{:5.1f}%" COLOR_OFF MT_MESSAGE "{:.{}}\r",
147+
rsgain::print("\33[2K " COLOR_GREEN "{:5.1f}%" COLOR_OFF MT_MESSAGE "{:.{}}\r",
148148
100.f * ((float) (cur) / (float) (total)),
149149
path,
150150
w_path < 0 ? 0 : w_path

src/output.hpp

+20-8
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,25 @@
5353
#ifdef USE_STD_FORMAT
5454
#include <format>
5555
#include <print>
56-
#define format std::format
57-
#define print std::print
56+
namespace rsgain {
57+
template<class... Args>
58+
constexpr auto format(std::format_string<Args...> fmt, Args&&... args) { return std::format(fmt, std::forward<Args>(args)...); }
59+
template<class... Args>
60+
constexpr auto print(std::format_string<Args...> fmt, Args&&... args) { std::print(fmt, std::forward<Args>(args)...); }
61+
template<class... Args>
62+
constexpr auto print(std::FILE* stream, std::format_string<Args...> fmt, Args&&... args) { std::print(stream, fmt, std::forward<Args>(args)...); }
63+
}
5864
#else
5965
#include <fmt/core.h>
6066
#include <fmt/chrono.h>
61-
#define format fmt::format
62-
#define print fmt::print
67+
namespace rsgain {
68+
template<class... Args>
69+
constexpr auto format(fmt::format_string<Args...> fmt, Args&&... args) { return fmt::format(fmt, std::forward<Args>(args)...); }
70+
template<class... Args>
71+
constexpr auto print(fmt::format_string<Args...> fmt, Args&&... args) { fmt::print(fmt, std::forward<Args>(args)...); }
72+
template<class... Args>
73+
constexpr auto print(std::FILE* stream, fmt::format_string<Args...> fmt, Args&&... args) { fmt::print(stream, fmt, std::forward<Args>(args)...); }
74+
}
6375
#endif
6476

6577
#define COLOR_GREEN ""
@@ -87,10 +99,10 @@
8799
#define FAIL_PREFIX "[" COLOR_RED FAIL_CHAR COLOR_OFF "] "
88100

89101
extern int quiet;
90-
#define output_ok(format, ...) if (!quiet) print(OK_PREFIX format "\n" __VA_OPT__(,) __VA_ARGS__)
91-
#define output_warn(format, ...) if (!quiet) print(WARN_PREFIX format "\n" __VA_OPT__(,) __VA_ARGS__)
92-
#define output_error(format, ...) print(stderr, ERROR_PREFIX format "\n" __VA_OPT__(,) __VA_ARGS__)
93-
#define output_fail(format, ...) print(stderr, FAIL_PREFIX format "\n" __VA_OPT__(,) __VA_ARGS__)
102+
#define output_ok(format, ...) if (!quiet) rsgain::print(OK_PREFIX format "\n" __VA_OPT__(,) __VA_ARGS__)
103+
#define output_warn(format, ...) if (!quiet) rsgain::print(WARN_PREFIX format "\n" __VA_OPT__(,) __VA_ARGS__)
104+
#define output_error(format, ...) rsgain::print(stderr, ERROR_PREFIX format "\n" __VA_OPT__(,) __VA_ARGS__)
105+
#define output_fail(format, ...) rsgain::print(stderr, FAIL_PREFIX format "\n" __VA_OPT__(,) __VA_ARGS__)
94106

95107
class ProgressBar {
96108
private:

src/rsgain.cpp

+41-41
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ extern "C" {
5858
#include "output.hpp"
5959
#include "easymode.hpp"
6060

61-
#define PRINT_LIB(lib, version) print(" " COLOR_YELLOW " {:<14}" COLOR_OFF " {}\n", lib, version)
61+
#define PRINT_LIB(lib, version) rsgain::print(" " COLOR_YELLOW " {:<14}" COLOR_OFF " {}\n", lib, version)
6262
#define PRINT_LIB_FFMPEG(name, fn) \
6363
ffver = fn(); \
64-
PRINT_LIB(name, format("{}.{}.{}", AV_VERSION_MAJOR(ffver), AV_VERSION_MINOR(ffver), AV_VERSION_MICRO(ffver)))
64+
PRINT_LIB(name, rsgain::format("{}.{}.{}", AV_VERSION_MAJOR(ffver), AV_VERSION_MINOR(ffver), AV_VERSION_MICRO(ffver)))
6565

6666
#ifdef _WIN32
6767
#include <windows.h>
@@ -386,77 +386,77 @@ int main(int argc, char *argv[]) {
386386
}
387387

388388
static void help_main() {
389-
print(COLOR_RED "Usage: " COLOR_OFF "{}{}{} [OPTIONS] <command> ...\n", COLOR_GREEN, EXECUTABLE_TITLE, COLOR_OFF);
389+
rsgain::print(COLOR_RED "Usage: " COLOR_OFF "{}{}{} [OPTIONS] <command> ...\n", COLOR_GREEN, EXECUTABLE_TITLE, COLOR_OFF);
390390

391-
print("{} {} supports writing tags to the following file types:\n", PROJECT_NAME, PROJECT_VERSION);
392-
print(" FLAC (.flac), Ogg (.ogg, .oga, .spx), Opus (.opus), MP2 (.mp2),\n");
393-
print(" MP3 (.mp3), MP4 (.m4a), WMA (.wma), WavPack (.wv), APE (.ape),\n");
394-
print(" WAV (.wav), AIFF (.aiff, .aif, .snd), and TAK (.tak).\n");
391+
rsgain::print("{} {} supports writing tags to the following file types:\n", PROJECT_NAME, PROJECT_VERSION);
392+
rsgain::print(" FLAC (.flac), Ogg (.ogg, .oga, .spx), Opus (.opus), MP2 (.mp2),\n");
393+
rsgain::print(" MP3 (.mp3), MP4 (.m4a), WMA (.wma), WavPack (.wv), APE (.ape),\n");
394+
rsgain::print(" WAV (.wav), AIFF (.aiff, .aif, .snd), and TAK (.tak).\n");
395395

396-
print("\n");
397-
print(COLOR_RED "Options:\n" COLOR_OFF);
396+
rsgain::print("\n");
397+
rsgain::print(COLOR_RED "Options:\n" COLOR_OFF);
398398

399399
CMD_HELP("--help", "-h", "Show this help");
400400
CMD_HELP("--version", "-v", "Show version number");
401401

402-
print("\n");
403-
print(COLOR_RED "Commands:\n" COLOR_OFF);
402+
rsgain::print("\n");
403+
rsgain::print(COLOR_RED "Commands:\n" COLOR_OFF);
404404

405405
CMD_CMD("easy", "Easy Mode: Recursively scan a directory with recommended settings");
406406
CMD_CMD("custom", "Custom Mode: Scan individual files with custom settings");
407-
print("\n");
408-
print("Run '{} easy --help' or '{} custom --help' for more information.", EXECUTABLE_TITLE, EXECUTABLE_TITLE);
407+
rsgain::print("\n");
408+
rsgain::print("Run '{} easy --help' or '{} custom --help' for more information.", EXECUTABLE_TITLE, EXECUTABLE_TITLE);
409409

410-
print("\n\n");
411-
print("Please report any issues to " PROJECT_URL "/issues\n\n");
410+
rsgain::print("\n\n");
411+
rsgain::print("Please report any issues to " PROJECT_URL "/issues\n\n");
412412
}
413413

414414
static inline void help_custom() {
415-
print(COLOR_RED "Usage: " COLOR_OFF "{}{}{} custom [OPTIONS] FILES...\n", COLOR_GREEN, EXECUTABLE_TITLE, COLOR_OFF);
415+
rsgain::print(COLOR_RED "Usage: " COLOR_OFF "{}{}{} custom [OPTIONS] FILES...\n", COLOR_GREEN, EXECUTABLE_TITLE, COLOR_OFF);
416416

417-
print(" Custom Mode allows the user to specify the options to scan the files with. The\n");
418-
print(" list of files to scan must be listed explicitly after the options.\n");
419-
print("\n");
417+
rsgain::print(" Custom Mode allows the user to specify the options to scan the files with. The\n");
418+
rsgain::print(" list of files to scan must be listed explicitly after the options.\n");
419+
rsgain::print("\n");
420420

421-
print(COLOR_RED "Options:\n" COLOR_OFF);
421+
rsgain::print(COLOR_RED "Options:\n" COLOR_OFF);
422422
CMD_HELP("--help", "-h", "Show this help");
423-
print("\n");
423+
rsgain::print("\n");
424424

425425
CMD_HELP("--album", "-a", "Calculate album gain and peak");
426426
CMD_HELP("--skip-existing", "-S", "Don't scan files with existing ReplayGain information");
427-
print("\n");
427+
rsgain::print("\n");
428428

429429
CMD_HELP("--tagmode=s", "-s s", "Scan files but don't write ReplayGain tags (default)");
430430
CMD_HELP("--tagmode=d", "-s d", "Delete ReplayGain tags from files");
431431
CMD_HELP("--tagmode=i", "-s i", "Scan and write ReplayGain 2.0 tags to files");
432-
print("\n");
432+
rsgain::print("\n");
433433

434434
CMD_HELP("--loudness=n", "-l n", "Use n LUFS as target loudness (" STR(MIN_TARGET_LOUDNESS) " ≤ n ≤ " STR(MAX_TARGET_LOUDNESS) ")");
435-
print("\n");
435+
rsgain::print("\n");
436436

437437
CMD_HELP("--clip-mode=n", "-c n", "No clipping protection (default)");
438438
CMD_HELP("--clip-mode=p", "-c p", "Clipping protection enabled for positive gain values only");
439439
CMD_HELP("--clip-mode=a", "-c a", "Clipping protection always enabled");
440440
CMD_HELP("--max-peak=n", "-m n", "Use max peak level n dB for clipping protection");
441441
CMD_HELP("--true-peak", "-t", "Use true peak for peak calculations");
442442

443-
print("\n");
443+
rsgain::print("\n");
444444

445445
CMD_HELP("--lowercase", "-L", "Write lowercase tags (MP2/MP3/MP4/WMA/WAV/AIFF)");
446446
CMD_CONT("This is non-standard but sometimes needed");
447447
CMD_HELP("--id3v2-version=keep", "-I keep", "Keep file's existing ID3v2 version, 3 if none exists (default)");
448448
CMD_HELP("--id3v2-version=3", "-I 3", "Write ID3v2.3 tags to MP2/MP3/WAV/AIFF");
449449
CMD_HELP("--id3v2-version=4", "-I 4", "Write ID3v2.4 tags to MP2/MP3/WAV/AIFF");
450450

451-
print("\n");
451+
rsgain::print("\n");
452452

453453
CMD_HELP("--opus-mode=d", "-o d", "Write standard ReplayGain tags, clear header output gain (default)");
454454
CMD_HELP("--opus-mode=r", "-o r", "Write R128_*_GAIN tags, clear header output gain");
455455
CMD_HELP("--opus-mode=s", "-o s", "Same as 'r', plus override target loudness to -23 LUFS");
456456
CMD_HELP("--opus-mode=t", "-o t", "Write track gain to header output gain");
457457
CMD_HELP("--opus-mode=a", "-o a", "Write album gain to header output gain");
458458

459-
print("\n");
459+
rsgain::print("\n");
460460

461461
CMD_HELP("--output", "-O", "Output tab-delimited scan data to stdout");
462462
CMD_HELP("--output=s", "-O s", "Output with sep header (needed for Microsoft Excel compatibility)");
@@ -465,18 +465,18 @@ static inline void help_custom() {
465465
CMD_HELP("--preserve-mtimes", "-p", "Preserve file mtimes");
466466
CMD_HELP("--quiet", "-q", "Don't print scanning status messages");
467467

468-
print("\n");
468+
rsgain::print("\n");
469469

470-
print("Please report any issues to " PROJECT_URL "/issues\n");
471-
print("\n");
470+
rsgain::print("Please report any issues to " PROJECT_URL "/issues\n");
471+
rsgain::print("\n");
472472
}
473473

474474
static void version() {
475475
unsigned int ffver;
476476
int ebur128_v_major = 0;
477477
int ebur128_v_minor = 0;
478478
int ebur128_v_patch = 0;
479-
print(COLOR_GREEN PROJECT_NAME COLOR_OFF " " PROJECT_VERSION
479+
rsgain::print(COLOR_GREEN PROJECT_NAME COLOR_OFF " " PROJECT_VERSION
480480
#if defined COMMITS_SINCE_TAG && defined COMMIT_HASH
481481
"-r" COMMITS_SINCE_TAG "-" COMMIT_HASH
482482
#endif
@@ -485,36 +485,36 @@ static void version() {
485485

486486
// Library versions
487487
ebur128_get_version(&ebur128_v_major, &ebur128_v_minor, &ebur128_v_patch);
488-
PRINT_LIB("libebur128", format("{}.{}.{}", ebur128_v_major, ebur128_v_minor, ebur128_v_patch));
488+
PRINT_LIB("libebur128", rsgain::format("{}.{}.{}", ebur128_v_major, ebur128_v_minor, ebur128_v_patch));
489489
PRINT_LIB_FFMPEG("libavformat", avformat_version);
490490
PRINT_LIB_FFMPEG("libavcodec", avcodec_version);
491491
PRINT_LIB_FFMPEG("libavutil", avutil_version);
492492
PRINT_LIB_FFMPEG("libswresample", swresample_version);
493493
#if HAS_TAGLIB2
494494
TagLib::VersionNumber tver = TagLib::runtimeVersion();
495-
PRINT_LIB("TagLib", format("{}.{}{}", tver.majorVersion(), tver.minorVersion(), tver.patchVersion() ? format(".{}", tver.patchVersion()) : ""));
495+
PRINT_LIB("TagLib", rsgain::format("{}.{}{}", tver.majorVersion(), tver.minorVersion(), tver.patchVersion() ? rsgain::format(".{}", tver.patchVersion()) : ""));
496496
#else
497-
print("\n");
498-
print("Built with:\n");
499-
PRINT_LIB("TagLib", format("{}.{}{}", TAGLIB_MAJOR_VERSION, TAGLIB_MINOR_VERSION, TAGLIB_PATCH_VERSION ? format(".{}", TAGLIB_PATCH_VERSION) : ""));
497+
rsgain::print("\n");
498+
rsgain::print("Built with:\n");
499+
PRINT_LIB("TagLib", rsgain::format("{}.{}{}", TAGLIB_MAJOR_VERSION, TAGLIB_MINOR_VERSION, TAGLIB_PATCH_VERSION ? rsgain::format(".{}", TAGLIB_PATCH_VERSION) : ""));
500500
#endif
501-
print("\n");
501+
rsgain::print("\n");
502502

503503
#if defined(__GNUC__) && !defined(__clang__)
504-
print(COLOR_YELLOW "{:<17}" COLOR_OFF " GCC {}.{}\n", "Compiler:", __GNUC__, __GNUC_MINOR__);
504+
rsgain::print(COLOR_YELLOW "{:<17}" COLOR_OFF " GCC {}.{}\n", "Compiler:", __GNUC__, __GNUC_MINOR__);
505505
#endif
506506

507507
#ifdef __clang__
508-
print(COLOR_YELLOW "{:<17}" COLOR_OFF " "
508+
rsgain::print(COLOR_YELLOW "{:<17}" COLOR_OFF " "
509509
#ifdef __apple_build_version__
510510
"Apple "
511511
#endif
512512
"Clang {}.{}.{}\n", "Compiler:", __clang_major__, __clang_minor__, __clang_patchlevel__);
513513
#endif
514514

515515
#ifdef _MSC_VER
516-
print(COLOR_YELLOW "{:<17}" COLOR_OFF " Microsoft C/C++ {:.2f}\n", "Compiler:", (float) _MSC_VER / 100.0f);
516+
rsgain::print(COLOR_YELLOW "{:<17}" COLOR_OFF " Microsoft C/C++ {:.2f}\n", "Compiler:", (float) _MSC_VER / 100.0f);
517517
#endif
518518

519-
print(COLOR_YELLOW "{:<17}" COLOR_OFF " " BUILD_DATE "\n", "Build Date:");
519+
rsgain::print(COLOR_YELLOW "{:<17}" COLOR_OFF " " BUILD_DATE "\n", "Build Date:");
520520
}

src/rsgain.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#pragma once
22

3-
#define CMD_HELP(CMDL, CMDS, MSG) print(" {}{:<8} {:<20}{} {}.\n", COLOR_YELLOW, CMDS ",", CMDL, COLOR_OFF, MSG);
4-
#define CMD_CMD(CMD, MSG) print(" {}{:<22}{} {}.\n", COLOR_YELLOW, CMD, COLOR_OFF, MSG);
5-
#define CMD_CONT(MSG) print(" {}{:<8} {:<20}{} {}.\n", COLOR_YELLOW, "", "", COLOR_OFF, MSG);
3+
#define CMD_HELP(CMDL, CMDS, MSG) rsgain::print(" {}{:<8} {:<20}{} {}.\n", COLOR_YELLOW, CMDS ",", CMDL, COLOR_OFF, MSG);
4+
#define CMD_CMD(CMD, MSG) rsgain::print(" {}{:<22}{} {}.\n", COLOR_YELLOW, CMD, COLOR_OFF, MSG);
5+
#define CMD_CONT(MSG) rsgain::print(" {}{:<8} {:<20}{} {}.\n", COLOR_YELLOW, "", "", COLOR_OFF, MSG);
66
#define MATCH(x,y) !strcmp(x,y)
77
#define STR_CAT(a) #a
88
#define STR(a) STR_CAT(a)

0 commit comments

Comments
 (0)