![]() |
| | #1 |
| critical genius Join Date: Jul 2008 Location: SE Queens
Posts: 5,181
| Is this C++? I have a webcam that doesn't work under linux so I've decided to write a driver for it. I started reading an article demoing the process and right away ran into this: Code: static struct usb_driver led_driver = {
.owner = THIS_MODULE,
.name = "usbled",
.probe = led_probe,
.disconnect = led_disconnect,
.id_table = id_table,
};
|
| MK27 is offline | |
| | #2 |
| Kernel hacker Join Date: Jul 2007 Location: Farncombe, Surrey, England
Posts: 15,686
| It is a gcc extension to name the fields of a struct for the elements, rather than just putting the fields in the order they appear in the original struct. It should work just fine in C, as long as you are using gcc - which you probably will do in Linux. -- Mats
__________________ Compilers can produce warnings - make the compiler programmers happy: Use them! Please don't PM me for help - and no, I don't do help over instant messengers. |
| matsp is offline | |
| | #3 |
| Woof, woof! Join Date: Mar 2007 Location: Australia
Posts: 3,295
| > It is a gcc extension to name the fields of a struct for the elements It's standard in C99. Not sure if the Microsoft compilers adopted it or not. |
| zacs7 is offline | |
![]() |
| Tags |
| "could be", c++ |
| Thread Tools | |
| Display Modes | |
|