1 /* -*- C++ -*-
2  * File: libraw_version.h
3  * Copyright 2008-2020 LibRaw LLC (info@libraw.org)
4  * Created: Mon Sept  8, 2008
5  *
6  * LibRaw C++ interface
7  *
8 
9 LibRaw is free software; you can redistribute it and/or modify
10 it under the terms of the one of two licenses as you choose:
11 
12 1. GNU LESSER GENERAL PUBLIC LICENSE version 2.1
13 (See the file LICENSE.LGPL provided in LibRaw distribution archive for details).
14 
15 2. COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0
16 (See the file LICENSE.CDDL provided in LibRaw distribution archive for details).
17 
18  */
19 
20 #ifndef __VERSION_H
21 #define __VERSION_H
22 
23 #define LIBRAW_MAJOR_VERSION 0
24 #define LIBRAW_MINOR_VERSION 20
25 #define LIBRAW_PATCH_VERSION 2
26 #define LIBRAW_VERSION_TAIL Release
27 
28 #define LIBRAW_SHLIB_CURRENT 20
29 #define LIBRAW_SHLIB_REVISION 0
30 #define LIBRAW_SHLIB_AGE 0
31 
32 #define _LIBRAW_VERSION_MAKE(a, b, c, d) #a "." #b "." #c "-" #d
33 #define LIBRAW_VERSION_MAKE(a, b, c, d) _LIBRAW_VERSION_MAKE(a, b, c, d)
34 
35 #define LIBRAW_VERSION_STR                                                     \
36   LIBRAW_VERSION_MAKE(LIBRAW_MAJOR_VERSION, LIBRAW_MINOR_VERSION,              \
37                       LIBRAW_PATCH_VERSION, LIBRAW_VERSION_TAIL)
38 
39 #define LIBRAW_MAKE_VERSION(major, minor, patch)                               \
40   (((major) << 16) | ((minor) << 8) | (patch))
41 
42 #define LIBRAW_VERSION                                                         \
43   LIBRAW_MAKE_VERSION(LIBRAW_MAJOR_VERSION, LIBRAW_MINOR_VERSION,              \
44                       LIBRAW_PATCH_VERSION)
45 
46 #define LIBRAW_CHECK_VERSION(major, minor, patch)                              \
47   (LibRaw::versionNumber() >= LIBRAW_MAKE_VERSION(major, minor, patch))
48 
49 #define LIBRAW_RUNTIME_CHECK_VERSION_EXACT()                                   \
50   ((LibRaw::versionNumber() & 0xffff00) ==                                     \
51    LIBRAW_MAKE_VERSION(LIBRAW_MAJOR_VERSION, LIBRAW_MINOR_VERSION, 0))
52 
53 #define LIBRAW_RUNTIME_CHECK_VERSION_NOTLESS()                                 \
54   ((LibRaw::versionNumber() & 0xffff00) >=                                     \
55    LIBRAW_MAKE_VERSION(LIBRAW_MAJOR_VERSION, LIBRAW_MINOR_VERSION, 0))
56 
57 #define LIBRAW_COMPILE_CHECK_VERSION(major, minor)                             \
58   (LIBRAW_MAKE_VERSION(major, minor, 0) == (LIBRAW_VERSION & 0xffff00))
59 
60 #define LIBRAW_COMPILE_CHECK_VERSION_NOTLESS(major, minor)                     \
61   (LIBRAW_MAKE_VERSION(major, minor, 0) <= (LIBRAW_VERSION & 0xffff00))
62 
63 #endif
64