linux 设备驱动里的特殊结构体

    xiaoxiao2021-12-14  19

    就是这样的结构体定义:

    static struct platform_driver sunxi_pcm_driver = { .probe = sunxi_pcm_dev_probe, .remove = __exit_p(sunxi_pcm_dev_remove), .driver = { .name = "sunxi-codec", .owner = THIS_MODULE, }, }; 经常在代码里看到,一直都习以为常,以为标准C语言就是这样,可是仔细看看,还是有差别的,

    .probe这样的标记,标准C的结构体语法是不支持的,

    它是C99标准里面才有,而且C++也是不支持的,

    这个专有名词是standard C tagged structure initialization syntax.

    标准C标签结构体初始化语法

    参考的网址:

    http://stackoverflow.com/questions/3016107/what-is-tagged-structure-initialization-syntax

    转载请注明原文地址: https://ju.6miu.com/read-971469.html

    最新回复(0)