2 * have_fpos_pos - Determine if a __pos element in FILEPOS
4 * Copyright (C) 2000 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.2 $
21 * @(#) $Id: have_fpos_pos.c,v 30.2 2007/09/19 22:34:22 chongo Exp $
22 * @(#) $Source: /usr/local/src/bin/calc/RCS/have_fpos_pos.c,v $
24 * Under source code control: 2000/12/17 01:23
25 * File existed as early as: 2000
27 * chongo <was here> /\oo/\ http://www.isthe.com/chongo/
28 * Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/
32 * If the symbol HAVE_NO_FPOS is defined, we will output nothing.
33 * If the HAVE_FILEPOS_SCALAR is defined, we will output nothing.
34 * If we are able to compile this program, then we must have the
35 * __pos element in a non-scalar FILEPOS.
40 #include "have_fpos.h"
41 #include "have_posscl.h"
46 #if !defined(HAVE_NO_FPOS) && !defined(HAVE_FILEPOS_SCALAR)
47 fpos_t pos
; /* file position */
49 /* print a __pos element in fpos_t */
50 printf("#undef HAVE_FPOS_POS\n");
51 printf("#define HAVE_FPOS_POS 1 /* yes */\n\n");
53 /* determine __pos element size */
54 printf("#undef FPOS_POS_BITS\n");
55 printf("#undef FPOS_POS_LEN\n");
56 # if defined(FPOS_POS_BITS)
57 printf("#define FPOS_POS_BITS %d\n", FPOS_POS_BITS
);
58 printf("#define FPOS_POS_LEN %d\n", int(FPOS_POS_BITS
/8));
60 printf("#define FPOS_POS_BITS %d\n", sizeof(pos
.__pos
)*8);
61 printf("#define FPOS_POS_LEN %d\n", sizeof(pos
.__pos
));
65 /* we have no __pos element */
66 printf("#undef HAVE_FPOS_POS\t/* no */\n");
67 printf("#undef FPOS_POS_BITS\n");
68 printf("#undef FPOS_POS_LEN\n");