/* libmisc/_intercept.h - Interceptable ("weak") functions * * Copyright (C) 2024-2025 Luke T. Shumaker * SPDX-License-Identifier: AGPL-3.0-or-later */ #ifndef _LIBMISC__INTERCEPT_H_ #define _LIBMISC__INTERCEPT_H_ /* pico-sdk/newlib defines abort() to be [[gnu::weak]] already, but * depending on optimization options glibc might not, and GCC might * assume it knows what it does and optimize it out. So define our * own `__lm_` wrapper that GCC/glibc won't interfere with. */ [[noreturn]] void __lm_abort(void); /* While newlib defines putchar() to be [[gnu::weak]], pico_stdio does * not. Plus the above about optimizations. */ void __lm_putchar(unsigned char c); #endif /* _LIBMISC__INTERCEPT_H_ */