C Board  

Go Back   C Board > General Programming Boards > C Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 02-26-2009, 04:37 PM   #1
critical genius
 
MK27's Avatar
 
Join Date: Jul 2008
Location: SE Queens
Posts: 5,181
Is this C++?

Sigh.

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,
};
which if this is C++ my project just became more difficult, because some form of this struct is necessary.
__________________

"A man can't just sit around." -- Larry Walters
MK27 is offline   Reply With Quote
Old 02-26-2009, 04:44 PM   #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   Reply With Quote
Old 02-26-2009, 07:11 PM   #3
Woof, woof!
 
zacs7's Avatar
 
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.
__________________
"I.T. gets the chicky-babes" - M. Kelly
bakefile | vim
zacs7 is offline   Reply With Quote
Reply

Tags
"could be", c++

Thread Tools
Display Modes

Forum Jump


All times are GMT -6. The time now is 02:06 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22