hid_def icon indicating copy to clipboard operation
hid_def copied to clipboard

Several errors when trying to build test

Open odedsesame opened this issue 6 years ago • 5 comments

Looks like a great and useful project! Thank you!

When I try to build HID_TEST_SIMPLE I get numerous errors: this operator is not allowed in a constant expression function call is not allowed in a constant expression syntax error: identifier 'HID_DATA2'

There are also several warnings like: not enough arguments for function-like macro invocation 'HID_USAGE_PAGE2' not enough arguments for function-like macro invocation 'HID_USAGE2'

Digging a bit, I get to a use of a GLOBAL constant, but it is not defined. Is it supposed to be HID_TYPE_GLOBAL which is defined beforehand ?

Attaching a picture, thought maybe you'd have a quick solution

Capture

Thanks!!! Oded

odedsesame avatar May 02 '19 12:05 odedsesame

My hunch (based on BYTE_ORDER macro) is that it works with GCC, but probably not from Visual Studio (I'm testing on 2017). Can you confirm? Thanks!

odedsesame avatar May 02 '19 18:05 odedsesame

Of course, this project GCC-targeted for now, because many toolchains for embedded platforms is GCC-based too. But if you find way to get some macroses work with you preferred compiler it will be great and I would like to add support for that.

katyo avatar May 04 '19 16:05 katyo

Thanks for confirming!

In the meantime I've continued without these macros. I hope to get back to them some time, but it's not pressing any more, so the odds are low to be honest.

Still a great project for anyone using gcc! Kodus!!

odedsesame avatar May 05 '19 14:05 odedsesame

I changed endianness detection macros. Now you can define HID_ENDIAN macro yourself with your target endian (like #define HID_ENDIAN HID_ENDIAN_LITTLE before including hid_def.h or using comand-line arguments of compiler). Also I set it to little endian when msvc compiler is used with win32 platform. And of course, I continue support automatic detection of endianness for gcc and clang.

katyo avatar May 10 '19 06:05 katyo

Thanks Katyo for this addition. Unfortunately it still doesn't compile on Visual Studio. I guess it needs more testing/dev on VS until everything is ironed out. I apologize I don't have the bandwidth to support this right now.

Thanks again for the project though, it seems very useful!

odedsesame avatar May 19 '19 08:05 odedsesame