github.com/goccy/go-jit@v0.0.0-20200514131505-ff78d45cf6af/internal/ccall/include/jit/jit-defs.h (about)

     1  /*
     2   * jit-defs.h - Define the primitive numeric types for use by the JIT.
     3   *
     4   * Copyright (C) 2004  Southern Storm Software, Pty Ltd.
     5   *
     6   * The libjit library is free software: you can redistribute it and/or
     7   * modify it under the terms of the GNU Lesser General Public License
     8   * as published by the Free Software Foundation, either version 2.1 of
     9   * the License, or (at your option) any later version.
    10   *
    11   * The libjit library is distributed in the hope that it will be useful,
    12   * but WITHOUT ANY WARRANTY; without even the implied warranty of
    13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    14   * Lesser General Public License for more details.
    15   *
    16   * You should have received a copy of the GNU Lesser General Public
    17   * License along with the libjit library.  If not, see
    18   * <http://www.gnu.org/licenses/>.
    19   */
    20  
    21  #ifndef	_JIT_DEFS_H
    22  #define	_JIT_DEFS_H
    23  
    24  #ifdef	__cplusplus
    25  extern	"C" {
    26  #endif
    27  
    28  #ifdef _MSC_VER
    29  #define JIT_EXPORT_DATA extern __declspec(dllimport)
    30  #else
    31  #define JIT_EXPORT_DATA extern
    32  #endif
    33  
    34  
    35  
    36  typedef char jit_sbyte;
    37  typedef unsigned char jit_ubyte;
    38  typedef short jit_short;
    39  typedef unsigned short jit_ushort;
    40  typedef int jit_int;
    41  typedef unsigned int jit_uint;
    42  typedef long jit_nint;
    43  typedef unsigned long jit_nuint;
    44  typedef long jit_long;
    45  typedef unsigned long jit_ulong;
    46  typedef float jit_float32;
    47  typedef double jit_float64;
    48  typedef long double jit_nfloat;
    49  typedef void *jit_ptr;
    50  
    51  #define	JIT_NATIVE_INT64 1
    52  
    53  
    54  typedef jit_nuint jit_size_t;
    55  
    56  #if defined(__cplusplus) && defined(__GNUC__)
    57  # define JIT_NOTHROW		
    58  #else
    59  # define JIT_NOTHROW
    60  #endif
    61  
    62  #define	jit_min_int		(((jit_int) 1) << (sizeof(jit_int) * 8 - 1))
    63  #define	jit_max_int		((jit_int) (~jit_min_int))
    64  #define	jit_max_uint		((jit_uint) (~((jit_uint) 0)))
    65  #define	jit_min_long		(((jit_long) 1) << (sizeof(jit_long) * 8 - 1))
    66  #define	jit_max_long		((jit_long) (~jit_min_long))
    67  #define	jit_max_ulong		((jit_ulong) (~((jit_ulong) 0)))
    68  
    69  #ifdef	__cplusplus
    70  };
    71  #endif
    72  
    73  #endif /* _JIT_DEFS_H */