DPDK usage discussions
 help / color / mirror / Atom feed
* Anonymous structs in DPDK
@ 2022-12-13 12:51 Antonio Di Bacco
  2022-12-13 13:55 ` Ferruh Yigit
  0 siblings, 1 reply; 6+ messages in thread
From: Antonio Di Bacco @ 2022-12-13 12:51 UTC (permalink / raw)
  To: users

I noticed that DPDK include files have a number of anonymous/unnamed struct:

For example:

/**
 * The rte_spinlock_t type.
 */
typedef struct {
        volatile int locked; /**< lock status 0 = unlocked, 1 = locked */
} rte_spinlock_t;

This choice doesn't allow to use forward declaration. I need forward
declaration because I'm using a rte_spinlock_t pointer in a C++ class
and I don't want to include rte_spinlock.h to prevent my application
to include it as well.

Is there any reason to use unnamed structures?

Thx

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-12-14  8:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-13 12:51 Anonymous structs in DPDK Antonio Di Bacco
2022-12-13 13:55 ` Ferruh Yigit
2022-12-14  0:34   ` Stephen Hemminger
2022-12-14  8:03     ` Antonio Di Bacco
2022-12-14  8:12       ` Pavel Vazharov
2022-12-14  8:16         ` Antonio Di Bacco

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).