From 8eab616d6232099d9ad49af7be1f2e2d6b4c8d0f Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Fri, 4 Feb 2022 12:21:52 -0500 Subject: Add qpdf version macros to qpdf/DLL.h --- include/qpdf/DLL.h | 6 ++++++ include/qpdf/QPDF.hh | 3 ++- include/qpdf/Version.h | 34 ++++++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 include/qpdf/Version.h (limited to 'include') diff --git a/include/qpdf/DLL.h b/include/qpdf/DLL.h index 9c38f8a9..21ae2b88 100644 --- a/include/qpdf/DLL.h +++ b/include/qpdf/DLL.h @@ -23,6 +23,12 @@ #ifndef QPDF_DLL_HH #define QPDF_DLL_HH +/* The first version of qpdf to include the version constants is 10.6.0. */ +#define QPDF_MAJOR_VERSION 10 +#define QPDF_MINOR_VERSION 5 +#define QPDF_PATCH_VERSION 0 +#define QPDF_VERSION "10.5.0" + #if (defined _WIN32 || defined __CYGWIN__) && defined(DLL_EXPORT) # define QPDF_DLL __declspec(dllexport) # define QPDF_DLL_CLASS diff --git a/include/qpdf/QPDF.hh b/include/qpdf/QPDF.hh index ac395358..c19d5683 100644 --- a/include/qpdf/QPDF.hh +++ b/include/qpdf/QPDF.hh @@ -52,7 +52,8 @@ class BitWriter; class QPDF { public: - // Get the current version of the QPDF software + // Get the current version of the QPDF software. See also + // qpdf/Version.h QPDF_DLL static std::string const& QPDFVersion(); diff --git a/include/qpdf/Version.h b/include/qpdf/Version.h new file mode 100644 index 00000000..54063f0a --- /dev/null +++ b/include/qpdf/Version.h @@ -0,0 +1,34 @@ +/* Copyright (c) 2005-2021 Jay Berkenbilt + * + * This file is part of qpdf. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Versions of qpdf prior to version 7 were released under the terms + * of version 2.0 of the Artistic License. At your option, you may + * continue to consider qpdf to be licensed under those terms. Please + * see the manual for additional information. + */ + +#ifndef QPDF_VERSION_H +#define QPDF_VERSION_H + +/* The first version of qpdf to have these constants was 10.6.0. This + * file is included by qpdf/DLL.h, which is included by everything + * that adds to the public API, so you can test for these values + * without explicitly including this file in code that has to work + * with older qpdf than 10.6.0. + */ + + +#endif /* QPDF_VERSION_H */ -- cgit v1.2.3-70-g09d2