On 64-bit Windows a pointer is 64 bit, but long is still 32 bit for
backwards compatibility.
uintptr_t nicely hides this difference and also works on Linux.
[dsd: add appropriate include]
*/
#include <errno.h>
+#include <stdint.h>
#include <stdlib.h>
#include <string.h>
*dp++ = *sp++;
break;
case 'w': /* 16-bit word, convert from little endian to CPU */
- dp += ((unsigned long)dp & 1); /* Align to word boundary */
+ dp += ((uintptr_t)dp & 1); /* Align to word boundary */
if (host_endian) {
memcpy(dp, sp, 2);
#include <poll.h>
#include <stddef.h>
+#include <stdint.h>
#include <time.h>
#include <libusb.h>
* member - the list_head element in "type"
*/
#define list_entry(ptr, type, member) \
- ((type *)((char *)(ptr) - (unsigned long)(&((type *)0L)->member)))
+ ((type *)((uintptr_t)(ptr) - (uintptr_t)(&((type *)0L)->member)))
/* Get each entry from a list
* pos - A structure pointer has a "member" element