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