From owner-svn-src-all@FreeBSD.ORG Thu Dec 19 17:29:57 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 800FAF25; Thu, 19 Dec 2013 17:29:57 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6ACAC15B6; Thu, 19 Dec 2013 17:29:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJHTvrx025183; Thu, 19 Dec 2013 17:29:57 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJHTvAG025181; Thu, 19 Dec 2013 17:29:57 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201312191729.rBJHTvAG025181@svn.freebsd.org> From: Sergey Kandaurov Date: Thu, 19 Dec 2013 17:29:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r259617 - in stable/9/sys: mips/include powerpc/include X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 17:29:57 -0000 Author: pluknet Date: Thu Dec 19 17:29:56 2013 New Revision: 259617 URL: http://svnweb.freebsd.org/changeset/base/259617 Log: MFC r255194 and prerequisites r229494,229496: Introduce internal macros for __U/INT64_C to define the U/INT64_MAX/MIN values properly. The previous definition only worked if __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS were defined at the same time. Newer versions of gcc define __INT64_C and __UINT64_C, so avoid redefining them if gcc provides them. Applying r255194 fixes stable/9 host to allow source upgrading to the newer versions with usr.bin/dtc included in bootstrap tools. Approved by: imp (MFC to stable/9) Modified: stable/9/sys/mips/include/_stdint.h stable/9/sys/powerpc/include/_stdint.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/mips/include/_stdint.h ============================================================================== --- stable/9/sys/mips/include/_stdint.h Thu Dec 19 15:45:03 2013 (r259616) +++ stable/9/sys/mips/include/_stdint.h Thu Dec 19 17:29:56 2013 (r259617) @@ -66,6 +66,16 @@ #if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) +#ifndef __INT64_C +#ifdef __mips_n64 +#define __INT64_C(c) (c ## L) +#define __UINT64_C(c) (c ## UL) +#else +#define __INT64_C(c) (c ## LL) +#define __UINT64_C(c) (c ## ULL) +#endif +#endif + /* * ISO/IEC 9899:1999 * 7.18.2.1 Limits of exact-width integer types @@ -74,19 +84,19 @@ #define INT8_MIN (-0x7f-1) #define INT16_MIN (-0x7fff-1) #define INT32_MIN (-0x7fffffff-1) -#define INT64_MIN (-INT64_C(0x7fffffffffffffff)-1) +#define INT64_MIN (-__INT64_C(0x7fffffffffffffff)-1) /* Maximum values of exact-width signed integer types. */ #define INT8_MAX 0x7f #define INT16_MAX 0x7fff #define INT32_MAX 0x7fffffff -#define INT64_MAX INT64_C(0x7fffffffffffffff) +#define INT64_MAX __INT64_C(0x7fffffffffffffff) /* Maximum values of exact-width unsigned integer types. */ #define UINT8_MAX 0xff #define UINT16_MAX 0xffff #define UINT32_MAX 0xffffffff -#define UINT64_MAX UINT64_C(0xffffffffffffffff) +#define UINT64_MAX __UINT64_C(0xffffffffffffffff) /* * ISO/IEC 9899:1999 Modified: stable/9/sys/powerpc/include/_stdint.h ============================================================================== --- stable/9/sys/powerpc/include/_stdint.h Thu Dec 19 15:45:03 2013 (r259616) +++ stable/9/sys/powerpc/include/_stdint.h Thu Dec 19 17:29:56 2013 (r259617) @@ -65,6 +65,16 @@ #if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) +#ifndef __INT64_C +#ifdef __LP64__ +#define __INT64_C(c) (c ## L) +#define __UINT64_C(c) (c ## UL) +#else +#define __INT64_C(c) (c ## LL) +#define __UINT64_C(c) (c ## ULL) +#endif +#endif + /* * ISO/IEC 9899:1999 * 7.18.2.1 Limits of exact-width integer types @@ -73,19 +83,19 @@ #define INT8_MIN (-0x7f-1) #define INT16_MIN (-0x7fff-1) #define INT32_MIN (-0x7fffffff-1) -#define INT64_MIN (-INT64_C(0x7fffffffffffffff)-1) +#define INT64_MIN (-__INT64_C(0x7fffffffffffffff)-1) /* Maximum values of exact-width signed integer types. */ #define INT8_MAX 0x7f #define INT16_MAX 0x7fff #define INT32_MAX 0x7fffffff -#define INT64_MAX INT64_C(0x7fffffffffffffff) +#define INT64_MAX __INT64_C(0x7fffffffffffffff) /* Maximum values of exact-width unsigned integer types. */ #define UINT8_MAX 0xff #define UINT16_MAX 0xffff #define UINT32_MAX 0xffffffff -#define UINT64_MAX UINT64_C(0xffffffffffffffff) +#define UINT64_MAX __UINT64_C(0xffffffffffffffff) /* * ISO/IEC 9899:1999