mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-27 13:53:31 +01:00
Add the MIN and MAX macros for platforms that lack them
This commit is contained in:
parent
eb10d441b6
commit
f0b5f87eab
@ -553,6 +553,19 @@ void tor_cond_signal_all(tor_cond_t *cond);
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/** Macros for MIN/MAX. Never use these when the arguments could have
|
||||||
|
* side-effects.
|
||||||
|
* {With GCC extensions we could probably define a safer MIN/MAX. But
|
||||||
|
* depending on that safety would be dangerous, since not every platform
|
||||||
|
* has it.}
|
||||||
|
**/
|
||||||
|
#ifndef MAX
|
||||||
|
#define MAX(a,b) ( ((a)<(b)) ? (b) : (a) )
|
||||||
|
#endif
|
||||||
|
#ifndef MIN
|
||||||
|
#define MIN(a,b) ( ((a)>(b)) ? (b) : (a) )
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Platform-specific helpers. */
|
/* Platform-specific helpers. */
|
||||||
#ifdef MS_WINDOWS
|
#ifdef MS_WINDOWS
|
||||||
char *format_win32_error(DWORD err);
|
char *format_win32_error(DWORD err);
|
||||||
|
Loading…
Reference in New Issue
Block a user