+// this only converts the byte order of the value at buffer if the process is running under rosetta on an intel mac
+// floats and double's byte ordering should not be changed when searching for values because they may be swapped to '0.0'
+void bigEndianValue(void *buffer, Variable *variable)
+{
+ if (variable->_isEmulated)
+ {
+ if (variable->_type == TCInt16)
+ {
+ int16_t newValue = CFSwapInt16HostToBig(*((int16_t *)buffer));
+ memcpy(buffer, &newValue, sizeof(int16_t));
+ }
+ else if (variable->_type == TCInt32)
+ {
+ int32_t newValue = CFSwapInt32HostToBig(*((int32_t *)buffer));
+ memcpy(buffer, &newValue, sizeof(int32_t));
+ }
+ else if (variable->_type == TCInt64)
+ {
+ int64_t newValue = CFSwapInt64HostToBig(*((int64_t *)buffer));
+ memcpy(buffer, &newValue, sizeof(int64_t));
+ }
+ else if (variable->_type == TCFloat)
+ {
+ CFSwappedFloat32 newValue = CFConvertFloat32HostToSwapped(*((float *)buffer));
+ memcpy(buffer, &(newValue.v), sizeof(float));
+ }
+ else if (variable->_type == TCDouble)
+ {
+ CFSwappedFloat64 newValue = CFConvertDoubleHostToSwapped(*((double *)buffer));
+ memcpy(buffer, &(newValue.v), sizeof(double));
+ }
+ }
+}