/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is the Netscape Portable Runtime (NSPR).
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 1998-2000
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include <stdio.h>
#if defined(sgi)
#ifndef IRIX
#endif
#endif
#if defined(__sun)
#ifndef SOLARIS
#endif
#else
#ifndef SUNOS4
#endif
#endif
#endif
#if defined(__hpux)
#ifndef HPUX
#endif
#endif
#if defined(__alpha)
#endif
#endif
#if defined(_IBMR2)
#ifndef AIX
#endif
#endif
#if defined(linux)
#ifndef LINUX
#endif
#endif
#if defined(bsdi)
#ifndef BSDI
#endif
#endif
#if defined(M_UNIX)
#ifndef SCO
#endif
#endif
#ifndef UNIXWARE
#endif
#endif
#if defined(__APPLE__)
#ifndef DARWIN
#endif
#endif
#if defined(__NeXT__)
#ifndef NEXTSTEP
#endif
#endif
/************************************************************************/
/* Generate cpucfg.h */
#ifdef XP_PC
#ifdef WIN32
#else
#define INT64 long
#endif
#else
#define INT64 long
#else
#define INT64 long long
#endif
#endif
struct align_short {
char c;
short a;
};
struct align_int {
char c;
int a;
};
struct align_long {
char c;
long a;
};
struct align_PRInt64 {
char c;
INT64 a;
};
struct align_fakelonglong {
char c;
struct {
} a;
};
struct align_float {
char c;
float a;
};
struct align_double {
char c;
double a;
};
struct align_pointer {
char c;
void *a;
};
int bpb;
/* Used if shell doesn't support redirection. By default, assume it does. */
static int Log2(int n)
{
int log2 = 0;
if (n & (n-1))
log2++;
if (n >> 16)
if (n >> 8)
if (n >> 4)
if (n >> 2)
if (n >> 1)
log2++;
return log2;
}
/* We assume that int's are 32 bits */
static void do64(void)
{
union {
int i;
char c[4];
} u;
u.i = 0x01020304;
if (u.c[0] == 0x01) {
} else {
}
}
static void do32(void)
{
union {
long i;
char c[4];
} u;
u.i = 0x01020304;
if (u.c[0] == 0x01) {
} else {
}
}
/*
** Concievably this could actually be used; but there is lots of code out
** there with and's and shift's in it that assumes a byte is 8 bits, so
** forget about porting THIS code to those non 8 bit byte machines.
*/
static void BitsPerByte(void)
{
bpb = 8;
}
{
BitsPerByte();
/* If we got a command line argument, try to use it as the stream. */
++argv;
if(*argv) {
return 1;
}
} else {
}
if (sizeof(long) == 8) {
do64();
} else {
do32();
}
bpb * sizeof(double));
if (sizeof(INT64) < 8) {
/* this machine doesn't actually support PRInt64's */
} else {
}
return 0;
}