gecko-dev/cmd/xfe/cplusplusmain.cc

85 строки
2.3 KiB
C++

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Netscape 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 http://www.mozilla.org/NPL/
*
* 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 mozilla.org code.
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1998 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
*/
/*
*
* cplusplusmain.cc --- C++ main for compilers/linkers/link formats that require it.
*
* This file is required when you are linking in C++ code. Some older C++
* linkers (HP, COFF I think, etc) require main() to be in a C++ file for
* the C++ runtime loader to be linked in or invoked. This file does nothing
* but make a call to to the real main in mozilla.c, but it will link the C++
* runtime loader.
*
* Created: David Williams <djw@netscape.com>, May-26-1996
*
* RCSID: "$Id: cplusplusmain.cc,v 3.3 1999/11/02 22:32:12 dmose%mozilla.org Exp $"
*/
//
// As of Communicator 4.0b2, the client (which is built on hpux9) does not run
// on hpux10 because of the usual incompatibility stuff.
//
// The hard working xheads have built and run succesfully on 10, but the
// build process did not get updated in time for the 4.0b2 release.
//
// So if the client is run on hpux 10, the user will get a nasty surprise.
//
#if defined(HPUX9) || defined(hpux9)
#include <stdio.h>
#include <stdlib.h>
#include <sys/utsname.h>
extern "C" char *XP_GetString(int i);
extern "C" int XFE_HPUX_VERSION_NONSENSE;
#endif
extern "C" int mozilla_main(int argc, char** argv);
int
main(int argc, char** argv)
{
#if defined(HPUX9) || defined(hpux9)
struct utsname name;
uname(&name);
if ((name.release[2] == '1') && (name.release[3] == '0'))
{
fprintf(stdout,
XP_GetString(XFE_HPUX_VERSION_NONSENSE),
argv[0],
name.sysname,
name.release);
exit(1);
}
#endif
return mozilla_main(argc, argv);
}