portability: add support for Illumos

This still won't work on older Solaris systems, but modern Illumos
at least should build and run now.
This commit is contained in:
Justin Maggard
2014-05-14 17:53:25 -07:00
parent 361bc34f93
commit 34cb08928c
10 changed files with 58 additions and 30 deletions

View File

@ -375,9 +375,9 @@ _asf_load_string(FILE *fp, int type, int size, char *buf, int len)
unsigned char data[2048];
uint16_t wc;
int i, j;
int16_t *wd16;
int32_t *wd32;
int64_t *wd64;
int16_t *wd16;
i = 0;
if(size && (size <= sizeof(data)) && (size == fread(data, 1, size, fp)))
@ -413,11 +413,7 @@ _asf_load_string(FILE *fp, int type, int size, char *buf, int len)
if(size >= 8)
{
wd64 = (int64_t *) &data[0];
#if __WORDSIZE == 64
i = snprintf(buf, len, "%ld", le64_to_cpu(*wd64));
#else
i = snprintf(buf, len, "%lld", le64_to_cpu(*wd64));
#endif
i = snprintf(buf, len, "%lld", (long long)le64_to_cpu(*wd64));
}
break;
case ASF_VT_WORD: