64bit big endian problem

There are some software like openldap and mozilla LDAP c-sdk which use void* in function parameter. There I have the problem that long values not correct transmitted. e.g. this part of code will fail on Solaris Sparc compiled with Solaris Studio 12.3.

int foo(void* vp){
    long value;

    value = *(long*)vp;

long myvalue = 0;

Anybody has seen this problem also. How can I handle this without to change the interface of foo()?

asked: 2014-03-20 by: cgrzemba