# HG changeset patch # User jwe # Date 845223755 0 # Node ID 30cd01f9970cda0a1f45b1d526f54d2d4d470432 # Parent 49dc322cd9fb2c14aaa82cbab1ac636a247c153e [project @ 1996-10-13 16:22:35 by jwe] diff --git a/liboctave/ChangeLog b/liboctave/ChangeLog --- a/liboctave/ChangeLog +++ b/liboctave/ChangeLog @@ -1,3 +1,9 @@ +Sun Oct 13 11:19:00 1996 John W. Eaton + + * sun-utils.h: Conditionally declare MAIN__ too. Declare MAIN_ + and MAIN__ extern "C". + * sun-utils.cc: Include sun-utils.h here. Delete extern "C" stuff. + Sat Oct 12 12:40:00 1996 John W. Eaton * MArray-misc.cc: New file. diff --git a/liboctave/sun-utils.cc b/liboctave/sun-utils.cc --- a/liboctave/sun-utils.cc +++ b/liboctave/sun-utils.cc @@ -22,26 +22,27 @@ #include +#include "sun-utils.h" + // I think that this is really only needed if linking to Fortran // compiled libraries on a Sun. It also seems to be needed on // Linux/ELF systems with g77. It should never be called. -extern "C" +#if defined (sun) +int +MAIN_ () { -#if defined (sun) - int MAIN_ (void) - { - assert (0); - return 0; - } + assert (0); + return 0; +} #elif defined (linux) && defined (__ELF__) - int MAIN__ (void) - { - assert (0); - return 0; - } +int +MAIN__ () +{ + assert (0); + return 0; +} #endif -} /* ;;; Local Variables: *** diff --git a/liboctave/sun-utils.h b/liboctave/sun-utils.h --- a/liboctave/sun-utils.h +++ b/liboctave/sun-utils.h @@ -23,13 +23,15 @@ #if !defined (octave_sun_utils_h) #define octave_sun_utils_h 1 -#if defined (sun) +// I think that this is really only needed if linking to Fortran +// compiled libraries on a Sun. It also seems to be needed on +// Linux/ELF systems with g77. It should never be called. -// I think that this is really only needed if linking to Fortran -// compiled libraries on a Sun. It should never be called. -// There should probably be a sysdep.cc file, eh? - -extern "C" int MAIN_ (void); +#if defined (sun) +extern "C" int MAIN_ (); +#elif defined (linux) && defined (__ELF__) +extern "C" int MAIN__ (); +#endif // This is only needed to dereference pointers to doubles if mixing // GCC and Sun f77/cc compiled code. See the GCC manual (where the @@ -37,7 +39,7 @@ // which explains that doubles are not always aligned on 8 byte // boundaries. -#if defined (__GNUC__) +#if defined (sun) && defined (__GNUC__) inline double access_double (double *unaligned_ptr) @@ -68,7 +70,6 @@ #endif #endif -#endif /* ;;; Local Variables: ***