Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
gcc编译
signal-信号
rt-thread内核的libc_signal.h头文件没有gcc编译器的宏定义
发布于 2020-08-07 20:09:25 浏览:1881
订阅该版
```c #if defined(__CC_ARM) || defined(__CLANG_ARM) #define SIGHUP 1 /* #define SIGINT 2 */ #define SIGQUIT 3 /* #define SIGILL 4 */ #define SIGTRAP 5 /* #define SIGABRT 6 */ #define SIGEMT 7 /* #define SIGFPE 8 */ #define SIGKILL 9 #define SIGBUS 10 /* #define SIGSEGV 11 */ #define SIGSYS 12 #define SIGPIPE 13 #define SIGALRM 14 /* #define SIGTERM 15 */ #define SIGURG 16 #define SIGSTOP 17 #define SIGTSTP 18 #define SIGCONT 19 #define SIGCHLD 20 #define SIGTTIN 21 #define SIGTTOU 22 #define SIGPOLL 23 #define SIGWINCH 24 /* #define SIGUSR1 25 */ /* #define SIGUSR2 26 */ #define SIGRTMIN 27 #define SIGRTMAX 31 #define NSIG 32 #define SIG_SETMASK 0 /* set mask with sigprocmask() */ #define SIG_BLOCK 1 /* set of signals to block */ #define SIG_UNBLOCK 2 /* set of signals to, well, unblock */ struct sigaction { _sig_func_ptr sa_handler; sigset_t sa_mask; int sa_flags; }; #define sigaddset(what,sig) (*(what) |= (1<<(sig)), 0) #define sigdelset(what,sig) (*(what) &= ~(1<<(sig)), 0) #define sigemptyset(what) (*(what) = 0, 0) #define sigfillset(what) (*(what) = ~(0), 0) #define sigismember(what,sig) (((*(what)) & (1<<(sig))) != 0) int sigprocmask (int how, const sigset_t *set, sigset_t *oset); int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact); #elif defined(__IAR_SYSTEMS_ICC__) #define SIGHUP 1 #define SIGINT 2 #define SIGQUIT 3 #define SIGILL 4 #define SIGTRAP 5 /* #define SIGABRT 6 */ #define SIGEMT 7 #define SIGFPE 8 #define SIGKILL 9 #define SIGBUS 10 #define SIGSEGV 11 #define SIGSYS 12 #define SIGPIPE 13 #define SIGALRM 14 #define SIGTERM 15 #define SIGURG 16 #define SIGSTOP 17 #define SIGTSTP 18 #define SIGCONT 19 #define SIGCHLD 20 #define SIGTTIN 21 #define SIGTTOU 22 #define SIGPOLL 23 #define SIGWINCH 24 #define SIGUSR1 25 #define SIGUSR2 26 #define SIGRTMIN 27 #define SIGRTMAX 31 #define NSIG 32 #define SIG_SETMASK 0 /* set mask with sigprocmask() */ #define SIG_BLOCK 1 /* set of signals to block */ #define SIG_UNBLOCK 2 /* set of signals to, well, unblock */ struct sigaction { _sig_func_ptr sa_handler; sigset_t sa_mask; int sa_flags; }; #define sigaddset(what,sig) (*(what) |= (1<<(sig)), 0) #define sigdelset(what,sig) (*(what) &= ~(1<<(sig)), 0) #define sigemptyset(what) (*(what) = 0, 0) #define sigfillset(what) (*(what) = ~(0), 0) #define sigismember(what,sig) (((*(what)) & (1<<(sig))) != 0) int sigprocmask (int how, const sigset_t *set, sigset_t *oset); int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact); #endif ``` 这个头文件只涉及到ARMCC,ARMCLANG和IAR的编译器的宏,gcc编译器的宏不见了,以致于官方给的信号的例程编译出错,找不到SIGUSR1。 
查看更多
qq_还没想好
2020-08-24
这家伙很懒,什么也没写!
这是哪个 BSP?
3
个回答
默认排序
按发布时间排序
武广高铁
2020-08-26
这家伙很懒,什么也没写!
这个是基于stm32f7芯片的工程,基于BSP的也是一样报错,所有的BSP使能信号机制后,再使能官方例程都有这个SIGUSR1未定义的问题(这个libc_signal.h头文件在rt-thread/include/libc目录中)
Langer
2024-06-19
这家伙很懒,什么也没写!
以前用的编译器是ac5,后面都用ac6,ac5用的是__CC_ARM,ac6用的是__clang__,所以把所有__CC_ARM替换成下划线下划线clang下划线下划线。(这里下划线不显示)
撰写答案
登录
注册新账号
关注者
0
被浏览
1.9k
关于作者
武广高铁
这家伙很懒,什么也没写!
提问
1
回答
15
被采纳
3
关注TA
发私信
相关问题
1
gcc交叉编译器编译stm32项目代码,bin文件比keil编译的大很多。
2
关于编译器重命名不报错
3
RTTstudio使用的GCC编译器遇见问题?求助
4
studio加载makfile
5
CM4 context_gcc.s 编译出错
6
RT-THREAD STUDIO建立的工程为什么ENV编译不了?
7
求助,关于X86编译
8
【求助】请问-DRT_USING_NEWLIB 是在哪里定义的?
9
代码编译是出现寄存器问题
10
创建动态线程失败 gcc编译环境
推荐文章
1
RT-Thread应用项目汇总
2
玩转RT-Thread系列教程
3
国产MCU移植系列教程汇总,欢迎查看!
4
机器人操作系统 (ROS2) 和 RT-Thread 通信
5
五分钟玩转RT-Thread新社区
6
【技术三千问】之《玩转ART-Pi》,看这篇就够了!干货汇总
7
关于STM32H7开发板上使用SDIO接口驱动SD卡挂载文件系统的问题总结
8
STM32的“GPU”——DMA2D实例详解
9
RT-Thread隐藏的宝藏之completion
10
【ART-PI】RT-Thread 开启RTC 与 Alarm组件
最新文章
1
RT-thred的stm32h723对应bsp包CubeMX添加其他外设报错
2
RT-Thread中的time溢出问题,时间戳溢出,解决方法
3
ART-PI使用env驱动ETH网卡,pc和板子可以ping通
4
SystemView线程名字不显示
5
只用网页也能跑RT-Smart 无门槛腾讯Cloud studio + smart-build快速构建
热门标签
RT-Thread Studio
串口
Env
LWIP
SPI
AT
Bootloader
Hardfault
CAN总线
FinSH
ART-Pi
DMA
USB
文件系统
RT-Thread
SCons
RT-Thread Nano
线程
MQTT
STM32
RTC
rt-smart
FAL
I2C_IIC
UART
ESP8266
cubemx
WIZnet_W5500
ota在线升级
PWM
BSP
flash
freemodbus
packages_软件包
潘多拉开发板_Pandora
定时器
ADC
GD32
flashDB
socket
编译报错
中断
Debug
rt_mq_消息队列_msg_queue
keil_MDK
ulog
SFUD
msh
C++_cpp
MicroPython
本月问答贡献
RTT_逍遥
8
个答案
2
次被采纳
KunYi
8
个答案
1
次被采纳
三世执戟
7
个答案
1
次被采纳
winfeng
2
个答案
1
次被采纳
chenyaxing
2
个答案
1
次被采纳
本月文章贡献
catcatbing
2
篇文章
5
次点赞
swet123
1
篇文章
4
次点赞
Days
1
篇文章
4
次点赞
YZRD
1
篇文章
2
次点赞
阳光的掌控者
1
篇文章
1
次点赞
回到
顶部
发布
问题
分享
好友
手机
浏览
扫码手机浏览
投诉
建议
回到
底部