libfprint/SOURCES/0137-fpi-ssm-fpi-usb-transfer-Use-fwd-declarations-to-avo.patch
2021-09-09 20:12:38 +00:00

53 lines
1.7 KiB
Diff

From 61ad30dc8b3c1a86728808f8e978dd05f834cdcc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= <mail@3v1n0.net>
Date: Mon, 16 Dec 2019 19:44:17 +0100
Subject: [PATCH 137/181] fpi-ssm, fpi-usb-transfer: Use fwd-declarations to
avoid headers dependencies
Don't make headers inclusions dependent on each others, given that FpiSsm
depends on FpiUsbTransfer and vice-versa, so fix the dependency cycle by
using forwarded declarations.
---
libfprint/fpi-ssm.h | 3 ++-
libfprint/fpi-usb-transfer.h | 3 +--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/libfprint/fpi-ssm.h b/libfprint/fpi-ssm.h
index fe64946..0e18ab6 100644
--- a/libfprint/fpi-ssm.h
+++ b/libfprint/fpi-ssm.h
@@ -22,7 +22,6 @@
#pragma once
#include "fp-device.h"
-#include "fpi-usb-transfer.h"
/* async drv <--> lib comms */
@@ -101,6 +100,8 @@ int fpi_ssm_get_cur_state (FpiSsm *machine);
/* Callbacks to be used by the driver instead of implementing their own
* logic.
*/
+typedef struct _FpiUsbTransfer FpiUsbTransfer;
+
void fpi_ssm_usb_transfer_cb (FpiUsbTransfer *transfer,
FpDevice *device,
gpointer unused_data,
diff --git a/libfprint/fpi-usb-transfer.h b/libfprint/fpi-usb-transfer.h
index 5b8fe9c..09d22e8 100644
--- a/libfprint/fpi-usb-transfer.h
+++ b/libfprint/fpi-usb-transfer.h
@@ -30,8 +30,7 @@ G_BEGIN_DECLS
#define FPI_USB_ENDPOINT_OUT 0x00
typedef struct _FpiUsbTransfer FpiUsbTransfer;
-
-#include "fpi-ssm.h"
+typedef struct _FpiSsm FpiSsm;
typedef void (*FpiUsbTransferCallback)(FpiUsbTransfer *transfer,
FpDevice *dev,
--
2.24.1