Browse Source

Fix 32-bit ISE 10.1 on 64-bit platform.

When trying to access a cable with this combination, ISE displays the
following error: "Cable operation is not supported when running the
32-bit version of the application on a 64-bit platform."

This is fixed by additionally overloading the uname function and replacing
x86_64 by i686 in the returned struct in the 32-bit version of this library.
The 64-bit version will still correctly return x86_64.
master
Michael Gernoth 17 years ago
parent
commit
c42237a305
  1. 20
      usb-driver.c

20
usb-driver.c

@ -39,6 +39,8 @@
#include <errno.h> #include <errno.h>
#include <inttypes.h> #include <inttypes.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/utsname.h>
#include <bits/wordsize.h>
#include "usb-driver.h" #include "usb-driver.h"
#include "config.h" #include "config.h"
@ -937,3 +939,21 @@ int access(const char *pathname, int mode) {
return (*func)(pathname, mode); return (*func)(pathname, mode);
} }
} }
#if __WORDSIZE == 32
int uname (struct utsname *__name) {
static int (*func) (struct utsname*);
int ret;
if (!func)
func = (int (*) (struct utsname*)) dlsym(RTLD_NEXT, "uname");
ret = (*func)(__name);
if (ret == 0 && (!strcmp(__name->machine, "x86_64"))) {
strcpy(__name->machine, "i686");
}
return ret;
}
#endif

Loading…
Cancel
Save