@Gilloo
I made a small OS4 makefile and compiled your sources for OS4 and tested the resulting programs. They seem to work but GCC issues warnings for almost all the printf statements. I don't want to post them all here but here is an example:
usblist1.c:78: warning: format '%ld' expects type 'long int', but argument 2 has type 'int'
Almost all the arguments have type int but the printf statements use %ld or %lx. Since you are using a different compiler and includes for 68k, the OS4 includes may be different and use different type definitions. Possibly your compiler just doesn't generate warnings for these kinds of errors. If you intend these files to also be tutorials for OS4 then the warnings should probably be eliminated by using the correct argument types in the printf statements.
Here is the simple makefile I wrote to compile usblist and usblist1 with OS4 GCC:
CC = gcc
CFLAGS = -O2 -mcrt=newlib -Wall
LDLIBS = -lauto
DEFS = -D__USE_INLINE__
.PHONY: all clean
all: usblist usblist1
usblist:
$(CC) $(CFLAGS) $(DEFS) usblist.c unistr.c -o $@ $(LDLIBS)
usblist1:
$(CC) $(CFLAGS) $(DEFS) usblist1.c unistr.c -o $@ $(LDLIBS)
clean:
@delete >NIL: *>NIL: usblist usblist1 QUIET
Here is the output from usblist1 -v:
USB opened
USBSysBase at 0x6ff7fdd0
[1] rawifc at 0x6ff06510
product="Front Roothub (unit 1)"
DEVICE (id=1,len=18)
USBVer 0100
Class 9
SubClass 0
Protocol 0
MaxPacketSize0 64
VendorID 0000
Product 0000
DevVer 0100
ManufacturerStr 0
ProductStr 1
SerialStr 0
NumConfigs 1
CONFIGURATION (id=2,len=10)
TotalLength 27
NumInterfaces 1
ConfigID 1
ConfigStr 0
Attributes 64
MaxPower 0 (0 mA)
INTERFACE (id=4,len=9)
InterfaceID 0
AltSetting 0
NumEndPoints 1
Class 9
SubClass 0
Protocol 0
InterfaceStr 0
EP (id=5,len=8)
Address 81
Attributes 03
MaxPacketSize 64
Interval 255 ms
INTERFACE (id=4,len=9)
InterfaceID 0
AltSetting 0
NumEndPoints 1
Class 9
SubClass 0
Protocol 0
InterfaceStr 0
[2] rawifc at 0x6ff06310
product="Rear Roothub (unit 0)"
DEVICE (id=1,len=18)
USBVer 0100
Class 9
SubClass 0
Protocol 0
MaxPacketSize0 64
VendorID 0000
Product 0000
DevVer 0100
ManufacturerStr 0
ProductStr 1
SerialStr 0
NumConfigs 1
CONFIGURATION (id=2,len=10)
TotalLength 27
NumInterfaces 1
ConfigID 1
ConfigStr 0
Attributes 64
MaxPower 0 (0 mA)
INTERFACE (id=4,len=9)
InterfaceID 0
AltSetting 0
NumEndPoints 1
Class 9
SubClass 0
Protocol 0
InterfaceStr 0
EP (id=5,len=8)
Address 81
Attributes 03
MaxPacketSize 64
Interval 255 ms
INTERFACE (id=4,len=9)
InterfaceID 0
AltSetting 0
NumEndPoints 1
Class 9
SubClass 0
Protocol 0
InterfaceStr 0
[3] rawifc at 0x6ff06650
vendor="Kensington "
product="Kensington USB/PS2 Wheel Mouse"
DEVICE (id=1,len=18)
USBVer 0110
Class 0
SubClass 0
Protocol 0
MaxPacketSize0 8
VendorID 047d
Product 102d
DevVer 0100
ManufacturerStr 1
ProductStr 2
SerialStr 0
NumConfigs 1
CONFIGURATION (id=2,len=9)
TotalLength 34
NumInterfaces 1
ConfigID 1
ConfigStr 0
Attributes 160
MaxPower 50 (100 mA)
INTERFACE (id=4,len=9)
InterfaceID 0
AltSetting 0
NumEndPoints 1
Class 3
SubClass 1
Protocol 2
InterfaceStr 0
HID (id=33,len=9)
bcdHID 0110
bCountryCode 0
bNumDescriptorType 1
bXDescriptorType 34
wXDescriptorLength 52
EP (id=5,len=7)
Address 81
Attributes 03
MaxPacketSize 4
Interval 10 ms
INTERFACE (id=4,len=9)
InterfaceID 0
AltSetting 0
NumEndPoints 1
Class 3
SubClass 1
Protocol 2
InterfaceStr 0
Bye!
I hope this is what you were looking for