1
0
mirror of https://github.com/gabime/spdlog.git synced 2025-01-15 17:27:57 +00:00

Compare commits

...

5 Commits

Author SHA1 Message Date
Gabi Melman
8001156ca8
Update stdout_sinks-inl.h 2021-04-08 23:20:36 +03:00
Gabi Melman
57e31f0a58
Merge pull request #1906 from LonghronShen/v1.x
fix bug #1790
2021-04-08 23:18:20 +03:00
Gabi Melman
51fadf6b7e
Merge pull request #1912 from SUPERustam/v1.x
Minor update, PEP8 format and f-string instead of format method
2021-04-08 23:13:33 +03:00
SUPERustam
5e35c2b6ab
Update extract_version.py 2021-04-08 09:56:01 +03:00
Steven Hangger
0385372314
fix bug #1790 2021-04-05 20:00:22 +08:00
2 changed files with 12 additions and 8 deletions

View File

@ -15,7 +15,11 @@
// under windows using fwrite to non-binary stream results in \r\r\n (see issue #1675)
// so instead we use ::FileWrite
#include <spdlog/details/windows_include.h>
#ifndef _USING_V110_SDK71_ // fileapi.h doesnt exist in winxp
#include <fileapi.h> // WriteFile (..)
#endif
#include <io.h> // _get_osfhandle(..)
#include <stdio.h> // _fileno(..)
#endif // WIN32

View File

@ -4,14 +4,14 @@ import os
import re
base_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
config_h = os.path.join(base_path, 'include', 'spdlog', 'version.h')
data = {'MAJOR': 0, 'MINOR': 0, 'PATCH': 0}
reg = re.compile(r'^\s*#define\s+SPDLOG_VER_([A-Z]+)\s+([0-9]+).*$')
config_h = os.path.join(base_path, 'include', 'spdlog', 'version.h')
data = {'MAJOR': 0, 'MINOR': 0, 'PATCH': 0}
reg = re.compile(r'^\s*#define\s+SPDLOG_VER_([A-Z]+)\s+([0-9]+).*$')
with open(config_h, 'r') as fp:
for l in fp:
m = reg.match(l)
if m:
data[m.group(1)] = int(m.group(2))
for l in fp:
m = reg.match(l)
if m:
data[m.group(1)] = int(m.group(2))
print('{}.{}.{}'.format(data['MAJOR'], data['MINOR'], data['PATCH']))
print(f"{data['MAJOR']}.{data['MINOR']}.{data['PATCH']}")