mirror of
https://github.com/holub/mame
synced 2025-05-29 00:53:09 +03:00

* mc6840ptm/mc6850acia: fixed so that LOG_OUTPUT_FUNC can be defined as printf * can09t: replaced static address map with a PAL driven address map enabling several BASIC commands previously failing * logmacro.h: Added support for C++ output streams using LOG_OUTPUT_STREAM instead of using printf as LOG_OUTPUT_FUNC [Vas] * 6840: removed c_str() in LOG statements
27 lines
729 B
C++
27 lines
729 B
C++
// license:BSD-3-Clause
|
|
// copyright-holders:Vas Crabb
|
|
#if defined(MAME_EMU_LOGMACRO_H) || !defined(__EMU_H__)
|
|
#error This file should only be included once per compilation unit after all other headers
|
|
#endif
|
|
#define MAME_EMU_LOGMACRO_H
|
|
|
|
#ifndef VERBOSE
|
|
#define VERBOSE 0
|
|
#endif
|
|
|
|
#ifndef LOG_OUTPUT_FUNC
|
|
#ifdef LOG_OUTPUT_STREAM
|
|
#define LOG_OUTPUT_FUNC [] (auto &&... args) { util::stream_format((LOG_OUTPUT_STREAM), std::forward<decltype(args)>(args)...); }
|
|
#else
|
|
#define LOG_OUTPUT_FUNC logerror
|
|
#endif
|
|
#endif
|
|
|
|
#ifndef LOG_GENERAL
|
|
#define LOG_GENERAL (1U << 0)
|
|
#endif
|
|
|
|
#define LOGMASKED(mask, ...) do { if (VERBOSE & (mask)) (LOG_OUTPUT_FUNC)(__VA_ARGS__); } while (false)
|
|
|
|
#define LOG(...) LOGMASKED(LOG_GENERAL, __VA_ARGS__)
|