home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / xfe / cplusplusmain.cc < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.3 KB  |  81 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18. /* 
  19.  *
  20.  *  cplusplus.cc --- C++ main for compilers/linkers/link formats that require it.
  21.  *
  22.  *  This file is required when you are linking in C++ code. Some older C++
  23.  *  linkers (HP, COFF I think, etc) require main() to be in a C++ file for
  24.  *  the C++ runtime loader to be linked in or invoked. This file does nothing
  25.  *  but make a call to to the real main in mozilla.c, but it will link the C++
  26.  *  runtime loader.
  27.  *
  28.  *  Created: David Williams <djw@netscape.com>, May-26-1996
  29.  *
  30.  *  RCSID: "$Id: cplusplusmain.cc,v 3.1 1998/03/28 03:19:58 ltabb Exp $"
  31.  */
  32.  
  33.  
  34. //
  35. // As of Communicator 4.0b2, the client (which is built on hpux9) does not run
  36. // on hpux10 because of the usual incompatibility stuff.
  37. //
  38. // The hard working xheads have built and run succesfully on 10, but the
  39. // build process did not get updated in time for the 4.0b2 release.
  40. //
  41. // So if the client is run on hpux 10, the user will get a nasty surprise.
  42. //
  43.  
  44. #if defined(HPUX9) || defined(hpux9)
  45. #include <stdio.h>
  46. #include <stdlib.h>
  47. #include <sys/utsname.h>
  48.  
  49. extern "C" char *XP_GetString(int i);
  50. extern "C" int XFE_HPUX_VERSION_NONSENSE;
  51.  
  52. #endif
  53.  
  54. extern "C" int mozilla_main(int argc, char** argv);
  55.  
  56. int
  57. main(int argc, char** argv)
  58. {
  59.  
  60. #if defined(HPUX9) || defined(hpux9)
  61.  
  62.     struct utsname name;
  63.  
  64.     uname(&name);
  65.  
  66.     if ((name.release[2] == '1') && (name.release[3] == '0'))
  67.     {
  68.         fprintf(stdout,
  69.                 XP_GetString(XFE_HPUX_VERSION_NONSENSE),
  70.                 argv[0],
  71.                 name.sysname,
  72.                 name.release);
  73.         
  74.         exit(1);
  75.     }
  76.  
  77. #endif
  78.  
  79.     return mozilla_main(argc, argv);
  80. }
  81.