summaryrefslogtreecommitdiff
path: root/src/pulsecore/device-port.h
diff options
context:
space:
mode:
authorTanu Kaskinen <tanuk@iki.fi>2011-11-27 17:16:53 +0200
committerTanu Kaskinen <tanuk@iki.fi>2011-11-27 17:22:42 +0200
commit46920bab16e545e9bc334b3b115d9e89940d66d3 (patch)
tree7f8797b7faf0edb2a24aac4a40ff86cf60d2bc3c /src/pulsecore/device-port.h
parente199077eca9b56ba43897fe25dffb224519f67fa (diff)
device-port: Fix the circular dependency problem more cleanly.
Declaring structs before including anything ensures that the structs are available for everybody in case of circular includes.
Diffstat (limited to 'src/pulsecore/device-port.h')
-rw-r--r--src/pulsecore/device-port.h12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/pulsecore/device-port.h b/src/pulsecore/device-port.h
index 7e7ed8de0..b6341258d 100644
--- a/src/pulsecore/device-port.h
+++ b/src/pulsecore/device-port.h
@@ -24,6 +24,7 @@
USA.
***/
+typedef struct pa_device_port pa_device_port;
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -34,16 +35,11 @@
#include <pulse/def.h>
#include <pulsecore/object.h>
#include <pulsecore/hashmap.h>
-
-/* Note: Including core.h here leads to circular references
- (device-port.h -> core.h -> sink.h -> device-port.h), hence the line below instead */
-struct pa_core;
-
-typedef struct pa_device_port pa_device_port;
+#include <pulsecore/core.h>
struct pa_device_port {
pa_object parent; /* Needed for reference counting */
- struct pa_core *core;
+ pa_core *core;
char *name;
char *description;
@@ -63,7 +59,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(struct pa_core *c, const char *name, const char *description, size_t extra);
+pa_device_port *pa_device_port_new(pa_core *c, const char *name, const char *description, size_t extra);
void pa_device_port_hashmap_free(pa_hashmap *h);