指向头文件中__u32的指针 [英] pointer to __u32 in a header file

查看:406
本文介绍了指向头文件中__u32的指针的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要传递一个像这样的指针

  extern int Si4709_dev_chan_get(__ u32 *); 

但是gcc抱怨丢失的括号。



<$在'*'令牌之前$ p $ Si4709_dev.h:130:error:expected')'

关于我能做什么的想法?

-Earlence

解决方案

也许你需要为__u32包含包含 typedef 的头文件,这通常是< asm / types.h> 或< sys / types.h>



在任何情况下,你应该依赖于像 uint32_t 这样可移植的东西,它应该是符合C99的实现的标准(它应该在 stdint.h


I need to pass a pointer like so

extern int Si4709_dev_chan_get(__u32 *);

but gcc complaints about missing brackets.

Si4709_dev.h:130: error: expected ‘)’ before ‘*’ token

any ideas on what I can do?

-Earlence

解决方案

Maybe you need to include the header that contains the typedef for __u32, this is usually <asm/types.h> or <sys/types.h>.

In anycase they shouldn't be portable, you should rely on something that is more likely to be portable like uint32_t which should be standard for C99 conform implementations (and it should be in stdint.h.

这篇关于指向头文件中__u32的指针的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆