MCPcopy Create free account
hub / github.com/apache/arrow / generate_visibility_macros

Function generate_visibility_macros

c_glib/tool/generate-version-header.py:86–102  ·  view source on GitHub ↗
(library: str)

Source from the content-addressed store, hash-verified

84
85
86def generate_visibility_macros(library: str) -> str:
87 return f"""#if (defined(_WIN32) || defined(__CYGWIN__)) && defined(_MSC_VER) && \
88 !defined({library}_STATIC_COMPILATION)
89# define {library}_EXPORT __declspec(dllexport)
90# define {library}_IMPORT __declspec(dllimport)
91#else
92# define {library}_EXPORT
93# define {library}_IMPORT
94#endif
95
96#ifdef {library}_COMPILATION
97# define {library}_API {library}_EXPORT
98#else
99# define {library}_API {library}_IMPORT
100#endif
101
102#define {library}_EXTERN {library}_API extern"""
103
104
105def generate_encoded_versions(library: str) -> str:

Callers 1

write_headerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected