Skip to content

Commit 51a8335

Browse files
committed
Moved version defines up in order to include from .rc file.
Blocked rest of header with ifndef so its possible to let the rc compiler only use the version defines.
1 parent 2bd9418 commit 51a8335

File tree

1 file changed

+44
-40
lines changed

1 file changed

+44
-40
lines changed

include/libssh2.h

+44-40
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,48 @@
4040
#ifndef LIBSSH2_H
4141
#define LIBSSH2_H 1
4242

43+
/* We use underscore instead of dash when appending DEV in dev versions just
44+
to make the BANNER define (used by src/session.c) be a valid SSH
45+
banner. Release versions have no appended strings and may of course not
46+
have dashes either. */
47+
#define LIBSSH2_VERSION "1.2.7_DEV"
48+
49+
/* The numeric version number is also available "in parts" by using these
50+
defines: */
51+
#define LIBSSH2_VERSION_MAJOR 1
52+
#define LIBSSH2_VERSION_MINOR 2
53+
#define LIBSSH2_VERSION_PATCH 7
54+
55+
/* This is the numeric version of the libssh2 version number, meant for easier
56+
parsing and comparions by programs. The LIBSSH2_VERSION_NUM define will
57+
always follow this syntax:
58+
59+
0xXXYYZZ
60+
61+
Where XX, YY and ZZ are the main version, release and patch numbers in
62+
hexadecimal (using 8 bits each). All three numbers are always represented
63+
using two digits. 1.2 would appear as "0x010200" while version 9.11.7
64+
appears as "0x090b07".
65+
66+
This 6-digit (24 bits) hexadecimal number does not show pre-release number,
67+
and it is always a greater number in a more recent release. It makes
68+
comparisons with greater than and less than work.
69+
*/
70+
#define LIBSSH2_VERSION_NUM 0x010207
71+
72+
/*
73+
* This is the date and time when the full source package was created. The
74+
* timestamp is not stored in the source code repo, as the timestamp is
75+
* properly set in the tarballs by the maketgz script.
76+
*
77+
* The format of the date should follow this template:
78+
*
79+
* "Mon Feb 12 11:35:33 UTC 2007"
80+
*/
81+
#define LIBSSH2_TIMESTAMP "DEV"
82+
83+
#ifndef LIBSSH2_VERSION_ONLY
84+
4385
#ifdef __cplusplus
4486
extern "C" {
4587
#endif
@@ -87,46 +129,6 @@ typedef unsigned long long libssh2_uint64_t;
87129
typedef long long libssh2_int64_t;
88130
#endif
89131

90-
/* We use underscore instead of dash when appending DEV in dev versions just
91-
to make the BANNER define (used by src/session.c) be a valid SSH
92-
banner. Release versions have no appended strings and may of course not
93-
have dashes either. */
94-
#define LIBSSH2_VERSION "1.2.7_DEV"
95-
96-
/* The numeric version number is also available "in parts" by using these
97-
defines: */
98-
#define LIBSSH2_VERSION_MAJOR 1
99-
#define LIBSSH2_VERSION_MINOR 2
100-
#define LIBSSH2_VERSION_PATCH 7
101-
102-
/* This is the numeric version of the libssh2 version number, meant for easier
103-
parsing and comparions by programs. The LIBSSH2_VERSION_NUM define will
104-
always follow this syntax:
105-
106-
0xXXYYZZ
107-
108-
Where XX, YY and ZZ are the main version, release and patch numbers in
109-
hexadecimal (using 8 bits each). All three numbers are always represented
110-
using two digits. 1.2 would appear as "0x010200" while version 9.11.7
111-
appears as "0x090b07".
112-
113-
This 6-digit (24 bits) hexadecimal number does not show pre-release number,
114-
and it is always a greater number in a more recent release. It makes
115-
comparisons with greater than and less than work.
116-
*/
117-
#define LIBSSH2_VERSION_NUM 0x010207
118-
119-
/*
120-
* This is the date and time when the full source package was created. The
121-
* timestamp is not stored in the source code repo, as the timestamp is
122-
* properly set in the tarballs by the maketgz script.
123-
*
124-
* The format of the date should follow this template:
125-
*
126-
* "Mon Feb 12 11:35:33 UTC 2007"
127-
*/
128-
#define LIBSSH2_TIMESTAMP "DEV"
129-
130132
/* Part of every banner, user specified or not */
131133
#define LIBSSH2_SSH_BANNER "SSH-2.0-libssh2_" LIBSSH2_VERSION
132134

@@ -1108,4 +1110,6 @@ LIBSSH2_API int libssh2_trace_sethandler(LIBSSH2_SESSION *session,
11081110
} /* extern "C" */
11091111
#endif
11101112

1113+
#endif /* LIBSSH2_VERSION_ONLY */
1114+
11111115
#endif /* LIBSSH2_H */

0 commit comments

Comments
 (0)