File: defs.h

package info (click to toggle)
libtioga-ruby 1.11-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 10,460 kB
  • ctags: 3,986
  • sloc: ansic: 38,451; ruby: 16,774; sh: 172; makefile: 111
file content (39 lines) | stat: -rw-r--r-- 1,480 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/**********************************************************************

   defs.h: 
   some definitions that are used everywhere and that depend on some
   HAVE_* macros.
   
   Copyright (C) 2006  Vincent Fourmond

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Library Public License as published
   by the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.
   
   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU Library General Public License for more details.
   
   You should have received a copy of the GNU Library General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
   
**********************************************************************/


#ifdef HAVE_ISNAN
/* we use isnan and isinf, which are much faster than the workaround */
#define is_okay_number(x) (! isnan(x) && ! isinf(x))
#else
#define is_okay_number(x) ((x) - (x) == 0.0)
#define isnan(x) ((x) != (x))
/* yes, as funny as it may look  NaN != NaN, and that's the only one */
#endif

/* Fix old versions of ruby.h */
#ifndef RSTRING_PTR
# define RSTRING_PTR(x) (RSTRING(x)->ptr)
# define RSTRING_LEN(x) (RSTRING(x)->len)
#endif