github.com/grailbio/base@v0.0.11/compress/libdeflate/lib_common.h (about)

     1  /*
     2   * lib_common.h - internal header included by all library code
     3   */
     4  
     5  #ifndef LIB_LIB_COMMON_H
     6  #define LIB_LIB_COMMON_H
     7  
     8  #ifdef LIBDEFLATE_H
     9  #  error "lib_common.h must always be included before libdeflate.h"
    10     /* because BUILDING_LIBDEFLATE must be set first */
    11  #endif
    12  
    13  #define BUILDING_LIBDEFLATE
    14  
    15  #include "common_defs.h"
    16  
    17  /*
    18   * Prefix with "_libdeflate_" all global symbols which are not part of the API.
    19   * This avoids exposing overly generic names when libdeflate is built as a
    20   * static library.
    21   *
    22   * Note that the chosen prefix is not really important and can be changed
    23   * without breaking library users.  It was just chosen so that the resulting
    24   * symbol names are unlikely to conflict with those from any other software.
    25   * Also note that this fixup has no useful effect when libdeflate is built as a
    26   * shared library, since these symbols are not exported.
    27   */
    28  #define SYM_FIXUP(sym)			_libdeflate_##sym
    29  #define aligned_malloc			SYM_FIXUP(aligned_malloc)
    30  #define aligned_free			SYM_FIXUP(aligned_free)
    31  #define deflate_get_compression_level	SYM_FIXUP(deflate_get_compression_level)
    32  #define _cpu_features			SYM_FIXUP(_cpu_features)
    33  #define setup_cpu_features		SYM_FIXUP(setup_cpu_features)
    34  
    35  #endif /* LIB_LIB_COMMON_H */