Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit016dba0

Browse files
committed
unix: Use common RAISE_ERRNO macro from mphalport.h.
1 parent503089e commit016dba0

File tree

3 files changed

+3
-13
lines changed

3 files changed

+3
-13
lines changed

‎unix/modos.c‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
#include"py/nlr.h"
3838
#include"py/runtime.h"
3939
#include"py/objtuple.h"
40+
#include"py/mphal.h"
4041
#include"extmod/misc.h"
4142

4243
// Can't include this, as FATFS structure definition is required,
@@ -51,10 +52,6 @@ extern const mp_obj_type_t mp_fat_vfs_type;
5152
#defineUSE_STATFS 1
5253
#endif
5354

54-
#defineRAISE_ERRNO(err_flag,error_val) \
55-
{ if (err_flag == -1) \
56-
{ mp_raise_OSError(error_val); } }
57-
5855
STATICmp_obj_tmod_os_stat(mp_obj_tpath_in) {
5956
structstatsb;
6057
mp_uint_tlen;

‎unix/modsocket.c‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#include"py/runtime.h"
4545
#include"py/stream.h"
4646
#include"py/builtin.h"
47+
#include"py/mphal.h"
4748

4849
/*
4950
The idea of this module is to implement reasonable minimum of
@@ -72,10 +73,6 @@ typedef struct _mp_obj_socket_t {
7273
constmp_obj_type_tmp_type_socket;
7374

7475
// Helper functions
75-
#defineRAISE_ERRNO(err_flag,error_val) \
76-
{ if (err_flag == -1) \
77-
{ mp_raise_OSError(error_val); } }
78-
7976
staticinlinemp_obj_tmp_obj_from_sockaddr(conststructsockaddr*addr,socklen_tlen) {
8077
returnmp_obj_new_bytes((constbyte*)addr,len);
8178
}

‎unix/modtermios.c‎

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,9 @@
2929
#include<unistd.h>
3030
#include<errno.h>
3131

32-
#include"py/nlr.h"
3332
#include"py/objlist.h"
3433
#include"py/runtime.h"
35-
36-
#defineRAISE_ERRNO(err_flag,error_val) \
37-
{ if (err_flag == -1) \
38-
{ mp_raise_OSError(error_val); } }
34+
#include"py/mphal.h"
3935

4036
STATICmp_obj_tmod_termios_tcgetattr(mp_obj_tfd_in) {
4137
structtermiosterm;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp