src/share/vm/libadt/port.hpp

Print this page


   1 /*
   2  * Copyright (c) 1997, 2009, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef _PORT_
  26 #define _PORT_



  27 // Typedefs for portable compiling
  28 
  29 #if defined(__GNUC__)
  30 
  31 #define INTERFACE       #pragma interface
  32 #define IMPLEMENTATION  #pragma implementation
  33 //INTERFACE
  34 #include <stddef.h>
  35 #include <stdlib.h>
  36 #include <string.h>
  37 
  38 // Access to the C++ class virtual function pointer
  39 // Put the class in the macro
  40 typedef void *VPTR;
  41 // G++ puts it at the end of the base class
  42 #define ACCESS_VPTR(class) VPTR&vptr(){return*(VPTR*)((char*)this+sizeof(class)-sizeof(void*));}
  43 
  44 #elif defined(__TURBOC__)
  45 
  46 #include <mem.h>


 187 // Do not define these for Tandem, because they conflict with typedefs in softieee.h.
 188 typedef float float32;          // 32-bit float
 189 typedef double float64;         // 64-bit float
 190 #endif // __TANDEM
 191 
 192 typedef jlong int64;            // Java long for my 64-bit type
 193 typedef julong uint64;          // Java long for my 64-bit type
 194 
 195 //-----------------------------------------------------------------------------
 196 // Nice constants
 197 uint32 gcd( uint32 x, uint32 y );
 198 int ff1( uint32 mask );
 199 int fh1( uint32 mask );
 200 uint32 rotate32( uint32 x, int32 cnt );
 201 
 202 
 203 //-----------------------------------------------------------------------------
 204 extern uint32 heap_totalmem;      // Current total memory allocation
 205 extern uint32 heap_highwater;     // Highwater mark to date for memory usage
 206 
 207 #endif // _PORT_
   1 /*
   2  * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.
   8  *
   9  * This code is distributed in the hope that it will be useful, but WITHOUT
  10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12  * version 2 for more details (a copy is included in the LICENSE file that
  13  * accompanied this code).
  14  *
  15  * You should have received a copy of the GNU General Public License version
  16  * 2 along with this work; if not, write to the Free Software Foundation,
  17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18  *
  19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20  * or visit www.oracle.com if you need additional information or have any
  21  * questions.
  22  *
  23  */
  24 
  25 #ifndef SHARE_VM_LIBADT_PORT_HPP
  26 #define SHARE_VM_LIBADT_PORT_HPP
  27 
  28 #include "utilities/top.hpp"
  29 
  30 // Typedefs for portable compiling
  31 
  32 #if defined(__GNUC__)
  33 
  34 #define INTERFACE       #pragma interface
  35 #define IMPLEMENTATION  #pragma implementation
  36 //INTERFACE
  37 #include <stddef.h>
  38 #include <stdlib.h>
  39 #include <string.h>
  40 
  41 // Access to the C++ class virtual function pointer
  42 // Put the class in the macro
  43 typedef void *VPTR;
  44 // G++ puts it at the end of the base class
  45 #define ACCESS_VPTR(class) VPTR&vptr(){return*(VPTR*)((char*)this+sizeof(class)-sizeof(void*));}
  46 
  47 #elif defined(__TURBOC__)
  48 
  49 #include <mem.h>


 190 // Do not define these for Tandem, because they conflict with typedefs in softieee.h.
 191 typedef float float32;          // 32-bit float
 192 typedef double float64;         // 64-bit float
 193 #endif // __TANDEM
 194 
 195 typedef jlong int64;            // Java long for my 64-bit type
 196 typedef julong uint64;          // Java long for my 64-bit type
 197 
 198 //-----------------------------------------------------------------------------
 199 // Nice constants
 200 uint32 gcd( uint32 x, uint32 y );
 201 int ff1( uint32 mask );
 202 int fh1( uint32 mask );
 203 uint32 rotate32( uint32 x, int32 cnt );
 204 
 205 
 206 //-----------------------------------------------------------------------------
 207 extern uint32 heap_totalmem;      // Current total memory allocation
 208 extern uint32 heap_highwater;     // Highwater mark to date for memory usage
 209 
 210 #endif // SHARE_VM_LIBADT_PORT_HPP