Skip to content

Commit 16423ff

Browse files
committed
解决某些平台,在不引入cstdio的情况下,无法编译
1 parent 864a048 commit 16423ff

5 files changed

Lines changed: 31 additions & 10 deletions

File tree

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,16 @@ sxtwl_cpp是一个[寿星天文历](http://www.nongli.net/sxwnl/)的C++实现日
5050
![python的执行效果图](doc/img/python.png)
5151

5252

53-
## 贡献者
53+
### Python懒人安装包下载地址 (只提供Win版本):
54+
55+
https://pan.baidu.com/s/1VR4MtPVV9iP9SSHNDjKZnQ
56+
57+
58+
## 交流沟通群
59+
60+
如果在使用过程中遇到困难,可加微信群(如二维码过期,邮件:lifulinghan@aol.com索要新的):
61+
![微信群](doc/img/wxq.jpg)
5462

55-
* 元谷 <lifulinghan@aol.com>
56-
* 没谱的人 <541632950@qq.com>
5763

5864
## 最后
5965

doc/img/wxq.jpg

76.8 KB
Loading

python/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,15 @@ print( Gan[gz.tg], Zhi[gz.dz])
130130
year = lunar.getYearCal(2018)
131131
```
132132

133-
### 懒人下载地址 (只提供Win版本):
133+
### 懒人安装包下载地址 (只提供Win版本):
134134

135135
https://pan.baidu.com/s/1VR4MtPVV9iP9SSHNDjKZnQ
136136

137+
## 交流沟通群
138+
139+
如果在使用过程中遇到困难,可加微信群(如二维码过期,邮件:lifulinghan@aol.com索要新的):
140+
![微信群](https://raw.githubusercontent.com/yuangu/sxtwl_cpp/master/doc/img/wxq.jpg)
141+
137142
### 最后
138143

139144
* 如果想加入此项目请联系 元谷(lifulinghan@aol.com)

python/setup.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,20 @@
88
import platform
99
import io
1010

11-
long_description = io.open('README.md', 'r', encoding="utf-8").read()
12-
if sys.version_info < (3, 0) and platform.system() == 'Windows':
13-
long_description = long_description.encode("gbk")
11+
long_description = ""
12+
with open('README.md') as f:
13+
long_description = f.read()
14+
15+
16+
# long_description = io.open('README.md', 'r', encoding="utf-8").read()
17+
# if sys.version_info < (3, 0) and platform.system() == 'Windows':
18+
# long_description = long_description.decode("utf-8").encode("gbk")
1419

1520
if sys.version_info >= (3, 0) and platform.system() == 'Windows':
1621
try:
17-
long_description.encode("mbcs")
22+
if isinstance(long_description, unicode):
23+
tmp=copy.deepcopy(long_description)
24+
tmp.encode("mbcs")
1825
except Exception as e:
1926
long_description = ''
2027
else:
@@ -47,6 +54,8 @@
4754
extra_compile_args = []
4855
if ccompiler.get_default_compiler() == "msvc":
4956
extra_compile_args.append("/utf-8")
57+
else:
58+
extra_compile_args.append('-std=c++11')
5059

5160

5261
sxtwl_module = setuptools.Extension('_sxtwl',
@@ -63,12 +72,12 @@
6372

6473
setuptools.setup(
6574
name="sxtwl",
66-
version="1.0.3",
75+
version="1.0.5",
6776
author="yuangu",
6877
author_email="lifulinghan@aol.com",
6978
description="sxtwl_cpp warpper for python",
7079
long_description=long_description,
71-
#long_description_content_type="text/markdown",
80+
long_description_content_type="text/markdown",
7281
license = "BSD",
7382
#package_dir={'src': '../src'},
7483
url="https://github.com/yuangu/sxtwl_cpp",

src/JD.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "JD.h"
22
#include "const.h"
33
#include <cstring>
4+
#include <cstdio>
45

56
//公历转儒略日
67
long double JD::DD2JD(int y, uint8_t m, long double d)

0 commit comments

Comments
 (0)