Apache2
apr_version.h
Go to the documentation of this file.
1 /* Licensed to the Apache Software Foundation (ASF) under one or more
2  * contributor license agreements. See the NOTICE file distributed with
3  * this work for additional information regarding copyright ownership.
4  * The ASF licenses this file to You under the Apache License, Version 2.0
5  * (the "License"); you may not use this file except in compliance with
6  * the License. You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef APR_VERSION_H
18 #define APR_VERSION_H
19 
41 #define APR_COPYRIGHT "Copyright (c) 2000-2023 The Apache Software " \
42  "Foundation or its licensors, as applicable."
43 
44 /* The numeric compile-time version constants. These constants are the
45  * authoritative version numbers for APR.
46  */
47 
53 #define APR_MAJOR_VERSION 2
54 
59 #define APR_MINOR_VERSION 0
60 
65 #define APR_PATCH_VERSION 0
66 
72 #define APR_IS_DEV_VERSION
73 
86 #define APR_VERSION_AT_LEAST(major,minor,patch) \
87 (((major) < APR_MAJOR_VERSION) \
88  || ((major) == APR_MAJOR_VERSION && (minor) < APR_MINOR_VERSION) \
89  || ((major) == APR_MAJOR_VERSION && (minor) == APR_MINOR_VERSION && (patch) <= APR_PATCH_VERSION))
90 
91 #if defined(APR_IS_DEV_VERSION) || defined(DOXYGEN)
93 #ifndef APR_IS_DEV_STRING
94 #define APR_IS_DEV_STRING "-dev"
95 #endif
96 #else
97 #define APR_IS_DEV_STRING ""
98 #endif
99 
100 /* APR_STRINGIFY is defined here, and also in apr_general.h, so wrap it */
101 #ifndef APR_STRINGIFY
103 #define APR_STRINGIFY(n) APR_STRINGIFY_HELPER(n)
105 #define APR_STRINGIFY_HELPER(n) #n
106 #endif
107 
109 #define APR_VERSION_STRING \
110  APR_STRINGIFY(APR_MAJOR_VERSION) "." \
111  APR_STRINGIFY(APR_MINOR_VERSION) "." \
112  APR_STRINGIFY(APR_PATCH_VERSION) \
113  APR_IS_DEV_STRING
114 
116 /* macro for Win32 .rc files using numeric csv representation */
117 #define APR_VERSION_STRING_CSV APR_MAJOR_VERSION, \
118  APR_MINOR_VERSION, \
119  APR_PATCH_VERSION
120 
121 
122 #ifndef APR_VERSION_ONLY
123 
124 /* The C language API to access the version at run time,
125  * as opposed to compile time. APR_VERSION_ONLY may be defined
126  * externally when preprocessing apr_version.h to obtain strictly
127  * the C Preprocessor macro declarations.
128  */
129 
130 #include "apr.h"
131 
132 #ifdef __cplusplus
133 extern "C" {
134 #endif
135 
140 typedef struct {
141  int major;
142  int minor;
143  int patch;
144  int is_dev;
145 } apr_version_t;
146 
154 
156 APR_DECLARE(const char *) apr_version_string(void);
157 
158 #ifdef __cplusplus
159 }
160 #endif
161 
162 #endif /* ndef APR_VERSION_ONLY */
163 
164 #endif /* ndef APR_VERSION_H */
APR Platform Definitions.
void apr_version(apr_version_t *pvsn)
const char * apr_version_string(void)
#define APR_DECLARE(x)
Definition: macros.h:6
Definition: apr_version.h:140
int major
Definition: apr_version.h:141
int patch
Definition: apr_version.h:143
int minor
Definition: apr_version.h:142
int is_dev
Definition: apr_version.h:144