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

     1  /*
     2   * jit-config.h - Configuration macros for the JIT.
     3   *
     4   * Copyright (C) 2011  Southern Storm Software, Pty Ltd.
     5   *
     6   * This file is part of the libjit library.
     7   *
     8   * The libjit library is free software: you can redistribute it and/or
     9   * modify it under the terms of the GNU Lesser General Public License
    10   * as published by the Free Software Foundation, either version 2.1 of
    11   * the License, or (at your option) any later version.
    12   *
    13   * The libjit library is distributed in the hope that it will be useful,
    14   * but WITHOUT ANY WARRANTY; without even the implied warranty of
    15   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    16   * Lesser General Public License for more details.
    17   *
    18   * You should have received a copy of the GNU Lesser General Public
    19   * License along with the libjit library.  If not, see
    20   * <http://www.gnu.org/licenses/>.
    21   */
    22  
    23  #ifndef _JIT_CONFIG_H
    24  #define	_JIT_CONFIG_H
    25  
    26  #include <config.h>
    27  
    28  /*
    29   * Determine what kind of system we are running on.
    30   */
    31  #if defined(_WIN32) || defined(WIN32)
    32  # define JIT_WIN32_PLATFORM	1
    33  #elif defined(__APPLE__) && defined(__MACH__)
    34  # define JIT_DARWIN_PLATFORM	1
    35  #elif defined(__linux__)
    36  # define JIT_LINUX_PLATFORM	1
    37  #endif
    38  
    39  /*
    40   * Determine the type of threading library that we are using.
    41   */
    42  #if defined(HAVE_PTHREAD_H) && defined(HAVE_LIBPTHREAD)
    43  # define JIT_THREADS_SUPPORTED	1
    44  # define JIT_THREADS_PTHREAD	1
    45  #elif defined(JIT_WIN32_PLATFORM)
    46  # define JIT_THREADS_SUPPORTED	1
    47  # define JIT_THREADS_WIN32	1
    48  #else
    49  # define JIT_THREADS_SUPPORTED	0
    50  #endif
    51  
    52  /*
    53   * Determine the type of virtual memory API that we are using.
    54   */
    55  #if defined(JIT_WIN32_PLATFORM)
    56  # define JIT_VMEM_SUPPORTED	1
    57  # define JIT_VMEM_WIN32		1
    58  #elif defined(HAVE_SYS_MMAN_H)
    59  # define JIT_VMEM_SUPPORTED	1
    60  # define JIT_VMEM_MMAP		1
    61  #else
    62  # define JIT_VMEM_SUPPORTED	0
    63  #endif
    64  
    65  /*
    66   * Determine which backend to use.
    67   */
    68  #if defined(USE_LIBJIT_INTERPRETER)
    69  # define JIT_BACKEND_INTERP	1
    70  # define JIT_HAVE_BACKEND	1
    71  #elif defined(__alpha) || defined(__alpha__)
    72  # define JIT_BACKEND_ALPHA	1
    73  # define JIT_HAVE_BACKEND	1
    74  #elif defined(__arm) || defined(__arm__)
    75  # define JIT_BACKEND_ARM	1
    76  # define JIT_HAVE_BACKEND	1
    77  #elif defined(__i386) || defined(__i386__) || defined(_M_IX86)
    78  # define JIT_BACKEND_X86	1
    79  # define JIT_HAVE_BACKEND	1
    80  #elif defined(__amd64) || defined(__amd64__) || defined(_x86_64) || defined(_x86_64__)
    81  # define JIT_BACKEND_X86_64	1
    82  # define JIT_HAVE_BACKEND	1
    83  #endif
    84  
    85  /*
    86   * Fallback  to interpreter if there is no appropriate native backend.
    87   */
    88  #if !defined(JIT_HAVE_BACKEND)
    89  # define JIT_BACKEND_INTERP	1
    90  #endif
    91  
    92  /*
    93  #define _JIT_COMPILE_DEBUG	1
    94  #define _JIT_BLOCK_DEBUG	1
    95   */
    96  
    97  #endif	/* _JIT_CONFIG_H */
    98