There is a circular reference between the driver info structure (which
lists callback routines) and a driver's routines (one of them may have
to reference the driver info). Add a forward declaration, and keep the
declaration and the implementation 'static' within the api.c source
file. Otherwise linker issues may arise should developers put the
declaration into protocol.h since it's marked as SR_PRIV in the template.
#include <config.h>
#include "protocol.h"
+static struct sr_dev_driver {lib}_driver_info;
+
static GSList *scan(struct sr_dev_driver *di, GSList *options)
{{
struct drv_context *drvc;
return SR_OK;
}}
-SR_PRIV struct sr_dev_driver {lib}_driver_info = {{
+static struct sr_dev_driver {lib}_driver_info = {{
.name = "{short}",
.longname = "{name}",
.api_version = 1,
.dev_acquisition_stop = dev_acquisition_stop,
.context = NULL,
}};
-
SR_REGISTER_DEV_DRIVER({lib}_driver_info);