pulsecore/packet: avoid redefinition of pa_packet structure
authorThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Tue, 17 Nov 2015 11:06:36 +0000 (12:06 +0100)
committerDavid Henningsson <david.henningsson@canonical.com>
Tue, 17 Nov 2015 13:27:53 +0000 (14:27 +0100)
commit1c5005ef77737a21b513eaa322d2f119e12f31e3
treec6d336d33758dd943157f65754bbc64ee33319b3
parent5504b26e1e0bff9e51f2ceb4f9e42b33e95a2a67
pulsecore/packet: avoid redefinition of pa_packet structure

packet.h defines:

  typedef struct pa_packet pa_packet;

and packet.c defines:

  typedef struct pa_packet {
    ...
  } pa_packet;

With old versions of gcc (such as gcc 4.5) this causes a redefinition
error at compile time:

pulsecore/packet.c:43:3: error: redefinition of typedef 'pa_packet'
pulsecore/packet.h:26:26: note: previous declaration of 'pa_packet' was here

In order to fix this, this commit changes the definition in packet.c
to just:

  struct pa_packet {
    ...
  };

This way, the contents of the structure remain opaque to users of
pa_packet outside packet.c, and the 'pa_packet' type remains usable.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=91334

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
src/pulsecore/packet.c