Closed JLP04 closed 1 year ago
That probably just means you have old tilibs headers installed on your system somewhere and it's using that instead. Make sure to remove old versions, then building again should work fine.
That issue was recently reported on IRC, on Mac-class hardware and software as well. The result of the discussion was that while some creative C++ coding could fix this, the simpler and more portable solution is to add and use a #define
for the length of a DUSBRawPacket
's data. There's already a #define
for the length of Nspire packets anyway.
I don't know enough C++ to fix the build.
Something like
diff --git a/libticalcs/trunk/src/dusb_vpkt.cc b/libticalcs/trunk/src/dusb_vpkt.cc
index e1e55c0a..67557cc7 100644
--- a/libticalcs/trunk/src/dusb_vpkt.cc
+++ b/libticalcs/trunk/src/dusb_vpkt.cc
@@ -365,10 +365,10 @@ TIEXPORT3 int TICALL dusb_set_buf_size(CalcHandle* handle, uint32_t size)
{
VALIDATE_HANDLE(handle);
- if (size > sizeof(DUSBRawPacket::data) + 1)
+ if (size > DUSB_DATA_SIZE + 1)
{
ticalcs_warning("Clamping dubious large DUSB buffer size");
- size = sizeof(DUSBRawPacket::data) + 1;
+ size = DUSB_DATA_SIZE + 1;
}
handle->priv.dusb_rpkt_maxlen = size;
diff --git a/libticalcs/trunk/src/ticalcs.h b/libticalcs/trunk/src/ticalcs.h
index 95db4493..e8c38028 100644
--- a/libticalcs/trunk/src/ticalcs.h
+++ b/libticalcs/trunk/src/ticalcs.h
@@ -352,6 +352,8 @@ typedef struct
//! Size of the header of a \a DUSBRawPacket
#define DUSB_HEADER_SIZE (4+1)
+//! Size of the data contained in \a DUSBRawPacket
+#define DUSB_DATA_SIZE (1023)
/**
* DUSBRawPacket:
@@ -360,10 +362,10 @@ typedef struct
**/
typedef struct
{
- uint32_t size; ///< raw packet size
- uint8_t type; ///< raw packet type
+ uint32_t size; ///< raw packet size
+ uint8_t type; ///< raw packet type
- uint8_t data[1023]; ///< raw packet data
+ uint8_t data[DUSB_DATA_SIZE]; ///< raw packet data
} DUSBRawPacket;
/**
but I'm in the middle of other changes in that repository clone :)
Cool, thanks.
I confirm this works on macOS.
Fixed by bfd030c.
MacOS Ventura 13.5.1 (Intel) Latest commit of tilibs
When building libticalcs, make returns the following: