1 /****************************************************************************** 2 * Project: libspatialindex - A C++ library for spatial indexing 3 * Author: Howard Butler, hobu.inc@gmail.com 4 ****************************************************************************** 5 * Copyright (c) 2011, Howard Butler 6 * 7 * All rights reserved. 8 * 9 * Permission is hereby granted, free of charge, to any person obtaining a 10 * copy of this software and associated documentation files (the "Software"), 11 * to deal in the Software without restriction, including without limitation 12 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 13 * and/or sell copies of the Software, and to permit persons to whom the 14 * Software is furnished to do so, subject to the following conditions: 15 * 16 * The above copyright notice and this permission notice shall be included 17 * in all copies or substantial portions of the Software. 18 * 19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 22 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 * DEALINGS IN THE SOFTWARE. 26 ******************************************************************************/ 27 28 29 #pragma once 30 31 /* Only define this stuff if we're not ANDROID */ 32 #ifndef ANDROID 33 34 #ifndef HAVE_SRAND48 35 36 #if HAVE_FEATURES_H 37 #include <features.h> 38 #ifndef __THROW 39 /* copy-pasted from sys/cdefs.h */ 40 /* GCC can always grok prototypes. For C++ programs we add throw() 41 to help it optimize the function calls. But this works only with 42 gcc 2.8.x and egcs. For gcc 3.2 and up we even mark C functions 43 as non-throwing using a function attribute since programs can use 44 the -fexceptions options for C code as well. */ 45 # if !defined __cplusplus && __GNUC_PREREQ (3, 3) 46 # define __THROW __attribute__ ((__nothrow__)) 47 # define __NTH(fct) __attribute__ ((__nothrow__)) fct 48 # else 49 # if defined __cplusplus && __GNUC_PREREQ (2,8) 50 # define __THROW throw () 51 # define __NTH(fct) fct throw () 52 # else 53 # define __THROW 54 # define __NTH(fct) fct 55 # endif 56 # endif 57 58 #endif 59 #else 60 # define __THROW 61 # define __NTH(fct) fct 62 #endif 63 64 extern void srand48(long int seed) __THROW; 65 66 extern unsigned short *seed48(unsigned short xseed[3]) __THROW; 67 68 extern long nrand48(unsigned short xseed[3]) __THROW; 69 70 extern long mrand48(void) __THROW; 71 72 extern long lrand48(void) __THROW; 73 74 extern void lcong48(unsigned short p[7]) __THROW; 75 76 extern long jrand48(unsigned short xseed[3]) __THROW; 77 78 extern double erand48(unsigned short xseed[3]) __THROW; 79 80 extern double drand48(void) __THROW; 81 82 #endif 83 84 /* Only define this stuff if we're not ANDROID */ 85 #endif