/* * magic_check * * Make sure the stored data we're trying to retrieve has been produced * on an ILP compatible system with the same byteorder. It croaks out in * case an error is detected. [ILP = integer-long-pointer sizes] * Returns null if error is detected, &PL_sv_undef otherwise. * * Note that there's no byte ordering info emitted when network order was * used at store time. */ static SV *magic_check(pTHX_ stcxt_t *cxt) { ... current = buf + c; /* sizeof(int) */ if ((int) *current++ != sizeof(int)) CROAK(("Integer size is not compatible")); /* sizeof(long) */ if ((int) *current++ != sizeof(long)) CROAK(("Long integer size is not compatible")); /* sizeof(char *) */ if ((int) *current != sizeof(char *)) CROAK(("Pointer size is not compatible")); if (use_NV_size) { /* sizeof(NV) */ if ((int) *++current != sizeof(NV)) CROAK(("Double size is not compatible")); } return &PL_sv_undef; /* OK */ }