1/* Copyright (c) 2017 - 2021 LiteSpeed Technologies Inc.  See LICENSE. */
2/*
3 * lsquic_shared_support.h - Support for building a shared library.
4 */
5
6#ifndef LSQUIC_SHARED_SUPPORT
7#define LSQUIC_SHARED_SUPPORT 1
8
9#ifndef LSQUIC_EXTERN
10
11#  ifdef _MSC_VER /* WIN32 */
12
13/* MSVC (and CMake on Windows) doesn't like to export extern const symbols, they need to be forced. */
14
15#    ifdef LSQUIC_SHARED_LIB
16
17#      ifdef LSQUIC_EXPORTS
18#        define LSQUIC_EXTERN __declspec(dllexport) extern
19#      else /* LSQUIC_EXPORTS */
20#        define LSQUIC_EXTERN __declspec(dllimport) extern
21#      endif /* LSQUIC_EXPORTS */
22
23#    else
24
25#    define LSQUIC_EXTERN extern
26
27#    endif
28
29#  else /* _MSC_VER */
30
31#    define LSQUIC_EXTERN extern
32
33#  endif /* _MSC_VER */
34
35#endif /* LSQUIC_EXTERN */
36
37#endif /* LSQUIC_SHARED_SUPPORT */
38