Adding call to _setmode for Windows only to specify binary stdout output piping.

This commit is contained in:
Demetri Maltsiniotis
2021-04-07 15:11:44 -05:00
parent 5f1536cc36
commit e664321cc6

View File

@ -584,6 +584,12 @@ int main(int argc, char** argv) {
window[i] = (float) (0.5f * (1.0f - cos(2 * M_PI * i / (fftSize - 1))));
}
#ifdef _MSC_VER
if(binary_output) {
_setmode(_fileno(stdout), _O_BINARY);
}
#endif
result = hackrf_init();
if( result != HACKRF_SUCCESS ) {
fprintf(stderr, "hackrf_init() failed: %s (%d)\n", hackrf_error_name(result), result);