modified: SpatialOmicsCoord.py
[GalaxyCodeBases.git] / c_cpp / etc / calc / have_posscl.c
blob041750f33d7b12cce13bada054efc93d199cf11f
1 /*
2 * have_posscl - determine if we have a scalar FILEPOS element
4 * Copyright (C) 1999 Landon Curt Noll
6 * Calc is open software; you can redistribute it and/or modify it under
7 * the terms of the version 2.1 of the GNU Lesser General Public License
8 * as published by the Free Software Foundation.
10 * Calc is distributed in the hope that it will be useful, but WITHOUT
11 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
13 * Public License for more details.
15 * A copy of version 2.1 of the GNU Lesser General Public License is
16 * distributed with calc under the filename COPYING-LGPL. You should have
17 * received a copy with calc; if not, write to Free Software Foundation, Inc.
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 * @(#) $Revision: 30.3 $
21 * @(#) $Id: have_posscl.c,v 30.3 2013/08/11 08:41:38 chongo Exp $
22 * @(#) $Source: /usr/local/src/bin/calc/RCS/have_posscl.c,v $
24 * Under source code control: 1996/07/13 12:57:22
25 * File existed as early as: 1996
27 * chongo <was here> /\oo/\ http://www.isthe.com/chongo/
28 * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
32 * usage:
33 * have_posscl
35 * On some systems, FILEPOS is a scalar value on which one can perform
36 * arithmetic operations, assignments and comparisons. On some systems
37 * FILEPOS is some sort of union or struct which must be converted into
38 * a ZVALUE in order to perform arithmetic operations, assignments and
39 * comparisons.
41 * This prog outputs several defines:
43 * HAVE_FILEPOS_SCALAR
44 * defined ==> ok to perform arithmetic ops, = and comparisons
45 * undefined ==> convert to ZVALUE first
49 #include <stdio.h>
50 #include <sys/types.h>
51 #include <sys/stat.h>
52 #include "have_fpos.h"
54 int
55 main(void)
57 #if !defined(FILEPOS_NON_SCALAR)
58 FILEPOS value; /* an FILEPOS to perform arithmatic on */
59 FILEPOS value2; /* an FILEPOS to perform arithmatic on */
62 * do some math opts on an FILEPOS
64 value = (FILEPOS)getpid();
65 value2 = (FILEPOS)-1;
66 if (value > (FILEPOS)1) {
67 --value;
69 #if !defined(_WIN32)
70 if (value <= (FILEPOS)getppid()) {
71 --value;
73 #endif
74 if (value == value2) {
75 value += value2;
77 value <<= 1;
78 if (!value) {
79 printf("/* something for the FILEPOS to do */\n");
83 * report FILEPOS as a scalar
85 printf("#undef HAVE_FILEPOS_SCALAR\n");
86 printf("#define HAVE_FILEPOS_SCALAR /* FILEPOS is a simple value */\n");
87 #else
88 printf("#undef HAVE_FILEPOS_SCALAR "
89 "/* FILEPOS is not a simple value */\n");
90 #endif
91 /* exit(0); */
92 return 0;