[PATCH 5/5] profile.h: fix incomplete type

Lubomir I. Ivanov neolit123 at gmail.com
Fri Nov 6 05:20:31 PST 2015


From: "Lubomir I. Ivanov" <neolit123 at gmail.com>

ruleritem.cpp throws an error about incomplete type
'struct gas_pressures'.

'struct gas_pressures' is defined in dive.h, so every header
that has usage of the type needs to include dive.h.

Such a header is profile.h which has 'struct gas_pressures pressures'
in 'struct plot_data', by including dive.h on top of profile.h
every source file (e.g. ruleritem.cpp) that includes profile.h will
now receive knowledge of a complete 'struct gas_pressures' type.

Signed-off-by: Lubomir I. Ivanov <neolit123 at gmail.com>
---
dive.h is a pretty big header and it has a lot of stuff which has
to go. files like ruleritem.cpp need not know about things like:

extern int subsurface_zip_close(struct zip *zip);
extern void subsurface_console_init(bool dedicated);
extern void subsurface_console_exit(void);
---
 subsurface-core/profile.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/subsurface-core/profile.h b/subsurface-core/profile.h
index a6dbfcf..71929f8 100644
--- a/subsurface-core/profile.h
+++ b/subsurface-core/profile.h
@@ -5,6 +5,8 @@
 extern "C" {
 #endif
 
+#include "dive.h"
+
 typedef enum {
 	STABLE,
 	SLOW,
-- 
1.7.11.msysgit.0



More information about the subsurface mailing list