For Windows, use _stat rather than stat
[openssl.git] / crypto / cversion.c
1 /*
2  * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
3  *
4  * Licensed under the OpenSSL license (the "License").  You may not use
5  * this file except in compliance with the License.  You can obtain a copy
6  * in the file LICENSE in the source distribution or at
7  * https://www.openssl.org/source/license.html
8  */
9
10 #include "internal/cryptlib.h"
11
12 #include "buildinf.h"
13
14 unsigned long OpenSSL_version_num(void)
15 {
16     return OPENSSL_VERSION_NUMBER;
17 }
18
19 const char *OpenSSL_version(int t)
20 {
21     if (t == OPENSSL_VERSION)
22         return OPENSSL_VERSION_TEXT;
23     if (t == OPENSSL_BUILT_ON) {
24 #ifdef DATE
25 # ifdef OPENSSL_USE_BUILD_DATE
26         return (DATE);
27 # else
28         return ("built on: reproducible build, date unspecified");
29 # endif
30 #else
31         return ("built on: date not available");
32 #endif
33     }
34     if (t == OPENSSL_CFLAGS) {
35 #ifdef CFLAGS
36         return (CFLAGS);
37 #else
38         return ("compiler: information not available");
39 #endif
40     }
41     if (t == OPENSSL_PLATFORM) {
42 #ifdef PLATFORM
43         return (PLATFORM);
44 #else
45         return ("platform: information not available");
46 #endif
47     }
48     if (t == OPENSSL_DIR) {
49 #ifdef OPENSSLDIR
50         return "OPENSSLDIR: \"" OPENSSLDIR "\"";
51 #else
52         return "OPENSSLDIR: N/A";
53 #endif
54     }
55     if (t == OPENSSL_ENGINES_DIR) {
56 #ifdef ENGINESDIR
57         return "ENGINESDIR: \"" ENGINESDIR "\"";
58 #else
59         return "ENGINESDIR: N/A";
60 #endif
61     }
62     return ("not available");
63 }