There are 2 problems with your code.
Firstly, in GCC you can't assign a GUID like that without warnings.
Expanding out the #define you have this
const GUID foo_audio_category = {0x6994AD04L, 0x93EF, 0x11D0, 0xA3,
0xCC, 0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}
to kill the warnings in gcc, you'll need to segregate the struct
const GUID category_guid = {0x6994AD04L, 0x93EF, 0x11D0, {0xA3, 0xCC,
0x00, 0xA0, 0xC9, 0x22, 0x31, 0x96}};
If you add the above directly into your code, you should see the 'warning:
missing braces around initializer' warnings dissapear.
Secondly, and this is your bigger problem, you've taken code meant for msvc
out of the MS headers.
Here is your header code:
#define STATIC_KSCATEGORY_AUDIO \
0x6994AD04L, 0x93EF, 0x11D0, 0xA3, 0xCC, 0x00, 0xA0, 0xC9, 0x22, 0x31,
0x96
DEFINE_GUIDSTRUCT("6994AD04-93EF-11D0-A3CC-00A0C9223196", KSCATEGORY_AUDIO);
#define KSCATEGORY_AUDIO DEFINE_GUIDNAMED(KSCATEGORY_AUDIO)
In msvc, to correctly assign the GUID, you should use the DEFINE_GUIDNAMED
assigned macro.
So for STATIC_KSCATEGORY_AUDIO, there is a KSCATEGORY_AUDIO which expands
calls DEFINE_GUIDNAMED(KSCATEGORY_AUDIO)
This expands to #define DEFINE_GUIDNAMED(n) __uuidof(struct n), and that's
where your problem lies.
__decelspec(uuid()) and __uuidof are a Microsoft extensions which lets you
get and set GUID's to / from the struct.
You've dropped these into your headers, which GCC doesn't understand, hence
your warnings.
IMO, the 3 solutions are to either
1. assign your GUID manually using the { ... { ... }} convention
2. change the ksmedia.h header to be more GCC friendly
3. add support for __decelspec(uuid()) and __uuidof to our code base. It
might be worth checking Wine for this as I think it's been done by them
before.
Hope that helps,
Ged.
-----Original Message-----
From: ros-dev-bounces(a)reactos.org [mailto:ros-dev-bounces@reactos.org] On
Behalf Of reactos-development(a)silverblade.co.uk
Sent: 27 September 2007 19:02
To: Ros dev
Subject: [ros-dev] Kernel streaming header mess / GUIDs
Hi,
Alex nudged me in IRC about this, but sadly I've not quite figured this out
yet.
It appears my definitions for Kernel Streaming GUIDs are not quite right.
This results in ugly code like so:
--
const GUID foo_audio_category = STATIC_KSCATEGORY_AUDIO;
DoSomethingWithTheGuid(&foo_audio_category);
--
Which consequently results in a barrage of compiler complaints about brace
initialization.
It should be possible to just do:
DoSomethingWithTheGuid(KSCATEGORY_AUDIO);
I'm clearly going wrong somewhere in KS.H or KSMEDIA.H but to be honest am
blind to whatever is causing the problem.
If anyone can figure out what I'm doing wrong here, I'd appreciate it.
Thanks.
-Andrew
_______________________________________________
Ros-dev mailing list
Ros-dev(a)reactos.org
http://www.reactos.org/mailman/listinfo/ros-dev
This message contains confidential information and is intended only for the individual
named. If you are not the named addressee you should not disseminate, distribute or copy
this e-mail. Please notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system. E-mail transmission cannot be
guaranteed to be secure or error-free as information could be intercepted, corrupted,
lost, destroyed, arrive late or incomplete, or contain viruses. The sender therefore does
not accept liability for any errors or omissions in the contents of this message, which
arise as a result of e-mail transmission. If verification is required please request a
hard-copy version.
Amteus Secure Communications Ltd
57 Cardigan Lane,
Leeds,
LS4 2LE
t: +44 (0) 870 8368770
f: +44 (0) 870 8368701
Registered in England No 4760795
http://www.amteus.com