From eed923be3e7e81a8d812bd224c138dee5e20f95f Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Sun, 1 Jun 2008 21:52:47 +0000 Subject: [PATCH] Rework smallint machinery so that it will reliably fail to compile even if arch overrides smallint size. Makes it easier to spot bugs on such arches. --- include/unistd.h | 8 ++++---- libc/sysdeps/linux/i386/bits/wordsize.h | 6 ++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/include/unistd.h b/include/unistd.h index 53ee6df64..3b72b8222 100644 --- a/include/unistd.h +++ b/include/unistd.h @@ -1109,11 +1109,11 @@ __END_DECLS #ifdef UCLIBC_INTERNAL -#ifndef smallint /* if arch didn't override it in bits/wordsize.h */ -typedef int smallint; -typedef unsigned smalluint; -#define smallint smallint +#ifndef smallint_type /* if arch didn't override it in bits/wordsize.h */ +#define smallint_type int #endif +typedef signed smallint_type smallint; +typedef unsigned smallint_type smalluint; #endif diff --git a/libc/sysdeps/linux/i386/bits/wordsize.h b/libc/sysdeps/linux/i386/bits/wordsize.h index 143fedadb..7c3cd9c7d 100644 --- a/libc/sysdeps/linux/i386/bits/wordsize.h +++ b/libc/sysdeps/linux/i386/bits/wordsize.h @@ -19,9 +19,7 @@ #define __WORDSIZE 32 #ifdef UCLIBC_INTERNAL -#ifndef smallint -typedef signed char smallint; -typedef unsigned char smalluint; -#define smallint smallint +#ifndef smallint_type +#define smallint_type char #endif #endif -- 2.11.0