1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-04 02:51:31 -08:00

Revert "Add new swap macro and use it"

typeof is an extension which does not exist in Standard C, so macros
using it are unsuitable for inclusion in Emacs.

This reverts commit 3788952327.
This commit is contained in:
Po Lu 2024-01-06 15:28:14 +08:00
parent 2f59052602
commit 657275529e
14 changed files with 111 additions and 41 deletions

View file

@ -67,10 +67,6 @@ INLINE_HEADER_BEGIN
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b))
/* Swap values of a and b. */
#define swap(a, b) \
do { typeof (a) __tmp; __tmp = (a); (a) = (b); (b) = __tmp; } while (0);
/* Number of elements in an array. */
#define ARRAYELTS(arr) (sizeof (arr) / sizeof (arr)[0])