From 89f27d507f3333080b90cdaee117669e5deb7270 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Wed, 26 May 2021 23:21:55 +0300 Subject: [PATCH] Add VS symbol export definitions. --- LICENSE.build | 19 +++++++++++++++++++ include/ogg/config_types.h.meson | 25 +++++++++++++++++++++++++ include/ogg/meson.build | 18 ++++++++++++++++++ meson.build | 1 + src/meson.build | 1 + 5 files changed, 64 insertions(+) create mode 100644 LICENSE.build create mode 100644 include/ogg/config_types.h.meson create mode 100644 include/ogg/meson.build diff --git a/LICENSE.build b/LICENSE.build new file mode 100644 index 0000000..b59833d --- /dev/null +++ b/LICENSE.build @@ -0,0 +1,19 @@ +Copyright (c) 2021 The Meson development team + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/include/ogg/config_types.h.meson b/include/ogg/config_types.h.meson new file mode 100644 index 0000000..8b5025a --- /dev/null +++ b/include/ogg/config_types.h.meson @@ -0,0 +1,25 @@ +#ifndef __CONFIG_TYPES_H__ +#define __CONFIG_TYPES_H__ + +/* these are filled in by configure */ +#mesondefine INCLUDE_INTTYPES_H +#mesondefine INCLUDE_STDINT_H +#mesondefine INCLUDE_SYS_TYPES_H + +#if INCLUDE_INTTYPES_H +# include +#endif +#if INCLUDE_STDINT_H +# include +#endif +#if INCLUDE_SYS_TYPES_H +# include +#endif + +typedef @SIZE16@ ogg_int16_t; +typedef @USIZE16@ ogg_uint16_t; +typedef @SIZE32@ ogg_int32_t; +typedef @USIZE32@ ogg_uint32_t; +typedef @SIZE64@ ogg_int64_t; + +#endif diff --git a/include/ogg/meson.build b/include/ogg/meson.build new file mode 100644 index 0000000..a13b3bc --- /dev/null +++ b/include/ogg/meson.build @@ -0,0 +1,18 @@ +cc = meson.get_compiler('c') + +cdata = configuration_data() +cdata.set10('INCLUDE_INTTYPES_H', cc.has_header('inttypes.h')) +cdata.set10('INCLUDE_STDINT_H', cc.has_header('stdint.h')) +cdata.set10('INCLUDE_SYS_TYPES_H', cc.has_header('sys/types.h')) + +# stdint.h is everywhere we care about. + +cdata.set('SIZE16', 'int16_t') +cdata.set('USIZE16', 'uint16_t') +cdata.set('SIZE32', 'int32_t') +cdata.set('USIZE32', 'uint32_t') +cdata.set('SIZE64', 'int64_t') + +configure_file(input: 'config_types.h.meson', + output: 'config_types.h', + configuration: cdata) diff --git a/meson.build b/meson.build index db9d6e6..792e71c 100644 --- a/meson.build +++ b/meson.build @@ -1,4 +1,5 @@ project('libogg', 'c', version : '1.3.2', license : 'bsd-like') incdir = include_directories('include') +subdir('include/ogg') subdir('src') diff --git a/src/meson.build b/src/meson.build index 5e39afa..0c4a949 100644 --- a/src/meson.build +++ b/src/meson.build @@ -3,6 +3,7 @@ sources = ['bitwise.c', 'framing.c'] libogg = library('ogg', sources, include_directories : incdir, + vs_module_defs: '../win32/ogg.def', ) bw_test = executable('bitwise', 'bitwise.c',