[uart] Fix RTL87xx compilation failure due to SUCCESS macro collision (#15054)

This commit is contained in:
J. Nick Koston
2026-03-23 09:17:59 +13:00
committed by GitHub
parent ca0523b86c
commit ba4be2a904
2 changed files with 19 additions and 0 deletions
+5
View File
@@ -30,12 +30,17 @@ enum UARTDirection {
const LogString *parity_to_str(UARTParityOptions parity);
/// Result of a flush() call.
// Some vendor SDKs (e.g., Realtek) define SUCCESS as a macro.
// Save and restore around the enum to avoid collisions with our scoped enum value.
#pragma push_macro("SUCCESS")
#undef SUCCESS
enum class FlushResult {
SUCCESS, ///< Confirmed: all bytes left the TX FIFO.
TIMEOUT, ///< Confirmed: timed out before TX completed.
FAILED, ///< Confirmed: driver or hardware error.
ASSUMED_SUCCESS, ///< Platform cannot report result; success is assumed.
};
#pragma pop_macro("SUCCESS")
class UARTComponent {
public: