]> code.delx.au - pulseaudio/commitdiff
pulsecore: Fix issue with circuilar definitions.
authorColin Guthrie <colin@mageia.org>
Sun, 27 Nov 2011 14:19:57 +0000 (14:19 +0000)
committerColin Guthrie <colin@mageia.org>
Sun, 27 Nov 2011 14:54:01 +0000 (14:54 +0000)
Without this fix, errors about previous definitions are generated in
numerous locations.

Example of error:

  CC     libpulsecore_1.98_la-auth-cookie.lo
In file included from ../../src/pulsecore/source.h:46:0,
                 from ../../src/pulsecore/sink.h:40,
                 from ../../src/pulsecore/core.h:50,
                 from ../../src/pulsecore/shared.h:25,
                 from ../../src/pulsecore/auth-cookie.c:33:
../../src/pulsecore/device-port.h:40:24: error: redefinition of typedef
'pa_core'
../../src/pulsecore/core.h:29:24: note: previous declaration of
'pa_core' was here
make[3]: *** [libpulsecore_1.98_la-auth-cookie.lo] Error 1

Overall it would be nicer if we could avoid this kind of fix, but it
would require further reorganisation that I'm not prepared to undertake
right now.

src/pulsecore/device-port.h

index f38702152f5b2b3e9c7c0e3ef5b82eecd60473ed..7e7ed8de0fbc35e72af4d5faf8956ae791a0d8ec 100644 (file)
 
 /* Note: Including core.h here leads to circular references
    (device-port.h -> core.h -> sink.h -> device-port.h), hence the line below instead */
-typedef struct pa_core pa_core;
+struct pa_core;
 
 typedef struct pa_device_port pa_device_port;
 
 struct pa_device_port {
     pa_object parent; /* Needed for reference counting */
-    pa_core *core;
+    struct pa_core *core;
 
     char *name;
     char *description;
@@ -63,7 +63,7 @@ PA_DECLARE_PUBLIC_CLASS(pa_device_port);
 
 #define PA_DEVICE_PORT_DATA(d) ((void*) ((uint8_t*) d + PA_ALIGN(sizeof(pa_device_port))))
 
-pa_device_port *pa_device_port_new(pa_core *c, const char *name, const char *description, size_t extra);
+pa_device_port *pa_device_port_new(struct pa_core *c, const char *name, const char *description, size_t extra);
 
 void pa_device_port_hashmap_free(pa_hashmap *h);