Skip to content

Commit 7c789d4

Browse files
committed
revise some RT_USING_POSIX to RT_USING_POSIX_DEVIO
1 parent bd80b7a commit 7c789d4

File tree

14 files changed

+34
-52
lines changed

14 files changed

+34
-52
lines changed

components/dfs/filesystems/devfs/devfs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ int dfs_device_fs_open(struct dfs_fd *file)
173173
if (device == RT_NULL)
174174
return -ENODEV;
175175

176-
#ifdef RT_USING_POSIX
176+
#ifdef RT_USING_POSIX_DEVIO
177177
if (device->fops)
178178
{
179179
/* use device fops */
@@ -192,7 +192,7 @@ int dfs_device_fs_open(struct dfs_fd *file)
192192
}
193193
}
194194
else
195-
#endif
195+
#endif /* RT_USING_POSIX_DEVIO */
196196
{
197197
result = rt_device_open(device, RT_DEVICE_OFLAG_RDWR);
198198
if (result == RT_EOK || result == -RT_ENOSYS)

components/drivers/serial/serial.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
#define DBG_LVL DBG_INFO
3737
#include <rtdbg.h>
3838

39-
#ifdef RT_USING_POSIX
39+
#ifdef RT_USING_POSIX_DEVIO
4040
#include <dfs_posix.h>
4141
#include <poll.h>
4242
#include <sys/ioctl.h>
@@ -203,7 +203,7 @@ const static struct dfs_file_ops _serial_fops =
203203
RT_NULL, /* getdents */
204204
serial_fops_poll,
205205
};
206-
#endif
206+
#endif /* RT_USING_POSIX_DEVIO */
207207

208208
/*
209209
* Serial poll routines
@@ -976,8 +976,7 @@ static void _tc_flush(struct rt_serial_device *serial, int queue)
976976
}
977977

978978
}
979-
980-
#endif
979+
#endif /* RT_USING_POSIX_TERMIOS */
981980

982981
static rt_err_t rt_serial_control(struct rt_device *dev,
983982
int cmd,
@@ -1020,7 +1019,7 @@ static rt_err_t rt_serial_control(struct rt_device *dev,
10201019
}
10211020

10221021
break;
1023-
#ifdef RT_USING_POSIX
1022+
#ifdef RT_USING_POSIX_DEVIO
10241023
#ifdef RT_USING_POSIX_TERMIOS
10251024
case TCGETA:
10261025
{
@@ -1215,7 +1214,7 @@ static rt_err_t rt_serial_control(struct rt_device *dev,
12151214
*(rt_size_t *)args = recved;
12161215
}
12171216
break;
1218-
#endif /*RT_USING_POSIX*/
1217+
#endif /* RT_USING_POSIX_DEVIO */
12191218
default :
12201219
/* control device */
12211220
ret = serial->ops->control(serial, cmd, args);
@@ -1270,7 +1269,7 @@ rt_err_t rt_hw_serial_register(struct rt_serial_device *serial,
12701269
/* register a character device */
12711270
ret = rt_device_register(device, name, flag);
12721271

1273-
#if defined(RT_USING_POSIX)
1272+
#ifdef RT_USING_POSIX_DEVIO
12741273
/* set fops */
12751274
device->fops = &_serial_fops;
12761275
#endif

components/drivers/serial/serial_v2.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#define DBG_LVL DBG_INFO
1717
#include <rtdbg.h>
1818

19-
#ifdef RT_USING_POSIX
19+
#ifdef RT_USING_POSIX_DEVIO
2020
#include <dfs_posix.h>
2121
#include <poll.h>
2222
#include <sys/ioctl.h>
@@ -179,7 +179,7 @@ const static struct dfs_file_ops _serial_fops =
179179
RT_NULL, /* getdents */
180180
serial_fops_poll,
181181
};
182-
#endif
182+
#endif /* RT_USING_POSIX_DEVIO */
183183

184184
static rt_size_t rt_serial_get_linear_buffer(struct rt_ringbuffer *rb,
185185
rt_uint8_t **ptr)
@@ -1135,7 +1135,7 @@ rt_err_t rt_hw_serial_register(struct rt_serial_device *serial,
11351135
/* register a character device */
11361136
ret = rt_device_register(device, name, flag);
11371137

1138-
#if defined(RT_USING_POSIX)
1138+
#ifdef RT_USING_POSIX_DEVIO
11391139
/* set fops */
11401140
device->fops = &_serial_fops;
11411141
#endif

components/drivers/src/pipe.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include <stdint.h>
1414
#include <sys/errno.h>
1515

16-
#ifdef RT_USING_POSIX
16+
#ifdef RT_USING_POSIX_DEVIO
1717
#include <dfs_file.h>
1818
#include <dfs_posix.h>
1919
#include <poll.h>
@@ -320,7 +320,7 @@ static const struct dfs_file_ops pipe_fops =
320320
RT_NULL,
321321
pipe_fops_poll,
322322
};
323-
#endif /* end of RT_USING_POSIX */
323+
#endif /* RT_USING_POSIX_DEVIO */
324324

325325
rt_err_t rt_pipe_open(rt_device_t device, rt_uint16_t oflag)
326326
{
@@ -479,7 +479,7 @@ rt_pipe_t *rt_pipe_create(const char *name, int bufsz)
479479
rt_free(pipe);
480480
return RT_NULL;
481481
}
482-
#ifdef RT_USING_POSIX
482+
#ifdef RT_USING_POSIX_DEVIO
483483
dev->fops = (void*)&pipe_fops;
484484
#endif
485485

@@ -529,7 +529,7 @@ int rt_pipe_delete(const char *name)
529529
return result;
530530
}
531531

532-
#ifdef RT_USING_POSIX
532+
#ifdef RT_USING_POSIX_DEVIO
533533
int pipe(int fildes[2])
534534
{
535535
rt_pipe_t *pipe;
@@ -575,4 +575,4 @@ int mkfifo(const char *path, mode_t mode)
575575

576576
return 0;
577577
}
578-
#endif
578+
#endif /* RT_USING_POSIX_DEVIO */

components/libc/compilers/common/sys/ioctl.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@
1111
#define _SYS_IOCTL_H
1212

1313
#include <rtconfig.h>
14-
#ifdef RT_USING_POSIX
1514
#include <dfs_posix.h>
16-
#endif
1715

1816
#ifdef _WIN32
1917
#include <winsock.h>

components/libc/posix/aio/SConscript

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ cwd = GetCurrentDir()
66
src = Glob('*.c')
77
CPPPATH = [cwd]
88

9-
group = DefineGroup('POSIX', src, depend = ['RT_USING_POSIX', 'RT_USING_POSIX_AIO'], CPPPATH = CPPPATH)
9+
group = DefineGroup('POSIX', src, depend = ['RT_USING_POSIX_AIO'], CPPPATH = CPPPATH)
1010

1111
Return('group')

components/libc/posix/src/libc.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@
2323

2424
int libc_system_init(void)
2525
{
26-
#ifdef RT_USING_POSIX
26+
#ifdef RT_USING_POSIX_DEVIO
2727
rt_device_t dev_console;
2828

2929
dev_console = rt_console_get_device();
3030
if (dev_console)
3131
{
3232
libc_stdio_set_console(dev_console->parent.name, O_RDWR);
3333
}
34-
#endif /* RT_USING_POSIX */
34+
#endif /* RT_USING_POSIX_DEVIO */
3535

3636
#if defined RT_USING_PTHREADS && !defined RT_USING_COMPONENTS_INIT
3737
pthread_system_init();
@@ -41,8 +41,7 @@ int libc_system_init(void)
4141
}
4242
INIT_COMPONENT_EXPORT(libc_system_init);
4343

44-
#ifdef RT_USING_POSIX
45-
44+
#ifdef RT_USING_POSIX_DEVIO
4645
#if defined(RT_USING_LIBC) && defined(RT_USING_NEWLIB)
4746
#define STDIO_DEVICE_NAME_MAX 32
4847
static FILE* std_console = NULL;
@@ -145,4 +144,4 @@ int libc_stdio_get_console(void) {
145144
return std_fd;
146145
}
147146
#endif /* defined(RT_USING_LIBC) && defined(RT_USING_NEWLIB) */
148-
#endif /* RT_USING_POSIX */
147+
#endif /* RT_USING_POSIX_DEVIO */

components/libc/posix/src/libc.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ extern "C" {
1717
#endif
1818

1919
int libc_system_init(void);
20-
#ifdef RT_USING_POSIX
20+
#ifdef RT_USING_POSIX_DEVIO
2121
int libc_stdio_get_console(void);
2222
int libc_stdio_set_console(const char* device_name, int mode);
23-
#endif /* RT_USING_POSIX */
23+
#endif /* RT_USING_POSIX_DEVIO */
2424

2525
#ifdef __cplusplus
2626
}

components/libc/posix/termios/SConscript

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ cwd = GetCurrentDir()
66
src = Glob('*.c') + Glob('*.cpp')
77
CPPPATH = [cwd]
88

9-
group = DefineGroup('POSIX', src,
10-
depend = ['RT_USING_LIBC', 'RT_USING_POSIX', 'RT_USING_POSIX_TERMIOS'],
11-
CPPPATH = CPPPATH)
9+
group = DefineGroup('POSIX', src, depend = ['RT_USING_LIBC', 'RT_USING_POSIX_TERMIOS'], CPPPATH = CPPPATH)
1210

1311
Return('group')

components/utilities/rt-link/src/rtlink_dev.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
#define RTLINK_SERV(dev) (((struct rt_link_device*)dev)->service)
2121

22-
#ifdef RT_USING_POSIX
22+
#ifdef RT_USING_POSIX_DEVIO
2323
#include <dfs_posix.h>
2424
#include <poll.h>
2525

@@ -148,7 +148,7 @@ const static struct dfs_file_ops _rtlink_fops =
148148
RT_NULL, /* getdents */
149149
rtlink_fops_poll,
150150
};
151-
#endif /* RT_USING_POSIX */
151+
#endif /* RT_USING_POSIX_DEVIO */
152152

153153
/* The event type for the service channel number,
154154
* which is used to wake up the service thread in blocking receive mode */
@@ -386,7 +386,7 @@ rt_err_t rt_link_dev_register(struct rt_link_device *rtlink,
386386
/* register a character device */
387387
ret = rt_device_register(device, name, flag);
388388

389-
#if defined(RT_USING_POSIX)
389+
#ifdef RT_USING_POSIX_DEVIO
390390
/* set fops */
391391
device->fops = &_rtlink_fops;
392392
#endif

0 commit comments

Comments
 (0)