changelog shortlog tags branches files raw gz bz2 help

Mercurial > hg > plan9front / changeset: Include integer limits from generic stdint.h in system-specific stdint.h

changeset 7369: 3d96c36e0cc3
parent 7368: d15d7627dee1
child 7371: b73f589b3c7d
child 7372: efe534158a5e
author: Ori Bernstein <ori@eigenstate.org>
date: Fri, 06 Sep 2019 18:01:52 -0700
files: amd64/include/ape/stdint.h arm64/include/ape/stdint.h sys/include/ape/limits.h sys/include/ape/stdint.h
description: Include integer limits from generic stdint.h in system-specific stdint.h
     1.1--- a/amd64/include/ape/stdint.h
     1.2+++ b/amd64/include/ape/stdint.h
     1.3@@ -1,31 +1,9 @@
     1.4-#ifndef _STDINT_H_
     1.5-#define _STDINT_H_ 1
     1.6-
     1.7-typedef char int8_t;
     1.8-typedef short int16_t;
     1.9-typedef int int32_t;
    1.10-typedef long long int64_t;
    1.11-typedef unsigned char uint8_t;
    1.12-typedef unsigned short uint16_t;
    1.13-typedef unsigned int uint32_t;
    1.14-typedef unsigned long long uint64_t;
    1.15-
    1.16-typedef long long intptr_t;
    1.17-typedef unsigned long long uintptr_t;
    1.18+#ifndef _STDINT_ARCH_H_
    1.19+#define _STDINT_ARCH_H_ 1
    1.20 
    1.21-#define INT8_MIN	0x80
    1.22-#define INT16_MIN	0x8000
    1.23-#define INT32_MIN	0x80000000
    1.24-#define INT64_MIN	0x8000000000000000LL
    1.25+typedef long long _intptr_t;
    1.26+typedef unsigned long long _uintptr_t;
    1.27 
    1.28-#define INT8_MAX	0x7f
    1.29-#define INT16_MAX	0x7fff
    1.30-#define INT32_MAX	0x7fffffff
    1.31-#define INT64_MAX	0x7fffffffffffffffULL
    1.32-
    1.33-#define UINT8_MAX	0xff
    1.34-#define UINT16_MAX	0xffff
    1.35-#define UINT32_MAX	0xffffffffL
    1.36-#define UINT64_MAX	0xffffffffffffffffULL
    1.37+#include "/sys/include/ape/stdint.h"
    1.38 
    1.39 #endif
     2.1--- a/arm64/include/ape/stdint.h
     2.2+++ b/arm64/include/ape/stdint.h
     2.3@@ -1,31 +1,9 @@
     2.4-#ifndef _STDINT_H_
     2.5-#define _STDINT_H_ 1
     2.6-
     2.7-typedef char int8_t;
     2.8-typedef short int16_t;
     2.9-typedef int int32_t;
    2.10-typedef long long int64_t;
    2.11-typedef unsigned char uint8_t;
    2.12-typedef unsigned short uint16_t;
    2.13-typedef unsigned int uint32_t;
    2.14-typedef unsigned long long uint64_t;
    2.15-
    2.16-typedef long long intptr_t;
    2.17-typedef unsigned long long uintptr_t;
    2.18+#ifndef _STDINT_ARCH_H_
    2.19+#define _STDINT_ARCH_H_ 1
    2.20 
    2.21-#define INT8_MIN	0x80
    2.22-#define INT16_MIN	0x8000
    2.23-#define INT32_MIN	0x80000000
    2.24-#define INT64_MIN	0x8000000000000000LL
    2.25+typedef long long _intptr_t;
    2.26+typedef unsigned long long _uintptr_t;
    2.27 
    2.28-#define INT8_MAX	0x7f
    2.29-#define INT16_MAX	0x7fff
    2.30-#define INT32_MAX	0x7fffffff
    2.31-#define INT64_MAX	0x7fffffffffffffffULL
    2.32-
    2.33-#define UINT8_MAX	0xff
    2.34-#define UINT16_MAX	0xffff
    2.35-#define UINT32_MAX	0xffffffffL
    2.36-#define UINT64_MAX	0xffffffffffffffffULL
    2.37+#include "/sys/include/ape/stdint.h"
    2.38 
    2.39 #endif
     3.1--- a/sys/include/ape/limits.h
     3.2+++ b/sys/include/ape/limits.h
     3.3@@ -75,12 +75,13 @@
     3.4 /*#define SEM_NSEMS_MAX _POSIX_SEM_NSEMS_MAX */
     3.5 /*#define SEM_VALUE_MAX _POSIX_SEM_VALUE_MAX */
     3.6 /*#define SIGQUEUE_MAX _POSIX_SIGQUEUE_MAX */
     3.7+#define SSIZE_MIN LONG_MIN
     3.8 #define SSIZE_MAX LONG_MAX
     3.9-#define SIZE_MAX ULONG_MAX
    3.10 /*#define STREAM_MAX _POSIX_STREAM_MAX */
    3.11 /*#define TIMER_MAX _POSIX_TIMER_MAX */
    3.12 #define TZNAME_MAX _POSIX_TZNAME_MAX
    3.13 
    3.14+
    3.15 #ifdef _LIMITS_EXTENSION
    3.16 /* some things are just too big for pedagogy (X!) */
    3.17 #include <sys/limits.h>
     4.1--- a/sys/include/ape/stdint.h
     4.2+++ b/sys/include/ape/stdint.h
     4.3@@ -1,8 +1,14 @@
     4.4-#ifndef _STDINT_H_
     4.5-#define _STDINT_H_ 1
     4.6+#ifndef _STDINT_GENERIC_H_
     4.7+#define _STDINT_GENERIC_H_ 1
     4.8 
     4.9+/*
    4.10+ * Default for 32 bit architectures, overriden by
    4.11+ * /$objtype/include/ape/stdint.h if needed.
    4.12+ */
    4.13+#ifndef _STDINT_ARCH_H_
    4.14 typedef int _intptr_t;
    4.15 typedef unsigned int _uintptr_t;
    4.16+#endif
    4.17 
    4.18 typedef char int8_t;
    4.19 typedef short int16_t;
    4.20@@ -12,6 +18,7 @@ typedef unsigned char uint8_t;
    4.21 typedef unsigned short uint16_t;
    4.22 typedef unsigned int uint32_t;
    4.23 typedef unsigned long long uint64_t;
    4.24+
    4.25 typedef _intptr_t intptr_t;
    4.26 typedef _uintptr_t uintptr_t;
    4.27 
    4.28@@ -35,4 +42,11 @@ typedef _uintptr_t uintptr_t;
    4.29 #define UINT32_MAX	0xffffffffL
    4.30 #define UINT64_MAX	0xffffffffffffffffULL
    4.31 
    4.32+/* 
    4.33+ * Right now, all of our size_t types are 32 bit, even on
    4.34+ * 64 bit architectures.
    4.35+ */
    4.36+#define SIZE_MIN	UINT32_MIN
    4.37+#define SIZE_MAX	UINT32_MAX
    4.38+
    4.39 #endif