1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License, Version 1.0 only 6 * (the "License"). You may not use this file except in compliance 7 * with the License. 8 * 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10 * or http://www.opensolaris.org/os/licensing. 11 * See the License for the specific language governing permissions 12 * and limitations under the License. 13 * 14 * When distributing Covered Code, include this CDDL HEADER in each 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 * If applicable, add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your own identifying 18 * information: Portions Copyright [yyyy] [name of copyright owner] 19 * 20 * CDDL HEADER END 21 */ 22 /* Copyright (c) 1988 AT&T */ 23 /* All Rights Reserved */ 24 25 26 /* 27 * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 28 * Use is subject to license terms. 29 */ 30 31 /* 32 * contains the definitions 33 * of the global constant __huge_val used 34 * by the floating point environment 35 */ 36 37 /* 38 * XXX - the preferred fix for this sits in delta 1.12. 39 * But the following code is the only way to fix this given the lint and cc 40 * we use now. Newer compilers and lints should fix this so we can 41 * put delta 1.12 back. See 6208626. 42 */ 43 44 #include <sys/feature_tests.h> 45 46 #undef _STDC_C99 /* to force the definition of '_h_val' */ 47 #undef __C99FEATURES__ /* to force the definition of '_h_val' */ 48 49 #include <math.h> /* for '_h_val' */ 50 51 /* IEEE infinity */ 52 const _h_val __huge_val = 53 #if defined(_LP64) /* long == long long */ 54 { 0x7ff0000000000000ull }; 55 #elif defined(_LONG_LONG_HTOL) /* like 32-bit sparc */ 56 { 0x7ff00000ul, 0x00000000ul }; 57 #elif defined(_LONG_LONG_LTOH) /* like 32-bit x86 */ 58 { 0x00000000ul, 0x7ff00000ul }; 59 #else 60 #error "none of { _LP64 _LONG_LONG_HTOL _LONG_LONG_LTOH } is defined" 61 #endif 62