Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions inc/usb.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <string>

#if defined ( EUD_WIN_ENV )
#include <wtypes.h>
#include <windows.h>
#include <conio.h>
#include <winioctl.h>
#include <libusb-1.0/libusb.h>
#include <libusb.h>
#endif

#ifdef __cplusplus
Expand Down
4 changes: 3 additions & 1 deletion src/jtag_eud.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@

#include "eud.h"
#include "jtag_eud.h"

#include <algorithm>
#include <string>
#include <math.h>
#include <stdlib.h>
Expand Down Expand Up @@ -1102,7 +1104,7 @@ JtagEudDevice::BitsFreeTdi()
uint32_t available_in = ((JTAG_IN_BUFFER_SIZE - usb_num_bytes_pending_in_) * 8) - (full_in + partial_in);

#if defined ( EUD_WIN_ENV )
return std::min(available_out, available_in);
return min(available_out, available_in);
#elif defined (EUD_LNX_ENV)
return std::min(available_out, available_in);
Comment on lines +1107 to 1109
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these two defined distinctly from one another on the baseline?

And @quic-kdybcio - why add this difference for EUD_WIN_ENV? How does it fail with std::min() instead?

Aside: we should probably explicitly include stdint.h for the sake of these types. Unless I missed it in there somewhere.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@androm3da I purposefully touched the questionable code just enough to make it compile.. that said, it's going to need quite some cleanup, if not a rewrite, to be considered maintainable...

#endif
Expand Down
1 change: 0 additions & 1 deletion src/usb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
#include <sstream>
#include <fstream>
#include <string>
#include "libusb-1.0/libusb.h"
#if defined ( EUD_WIN_ENV )
#include <ctime>
#endif
Expand Down