Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modbus-data.c: bswap checking inconsistency #383

Closed
dreamflow opened this issue May 4, 2017 · 3 comments
Closed

modbus-data.c: bswap checking inconsistency #383

dreamflow opened this issue May 4, 2017 · 3 comments

Comments

@dreamflow
Copy link

dreamflow commented May 4, 2017

in src/modbus-data.c in line 57

#if !defined(__CYGWIN__) && !defined(bswap_16)

and line 65

#if !defined(bswap_32)

look inconsistent.

shouldn't both lines be more consistent ?
like for example adapt line 65 according to line 57 and change line 65 to

#if !defined(__CYGWIN__) && !defined(bswap_32)

or vice versa adapt line 57 according to line 65 and change line 57 to

#if !defined(bswap_16)
@stephane
Copy link
Owner

stephane commented May 5, 2017

I can't remember why there is a check against CYGWIN on line 57.

@dreamflow
Copy link
Author

dreamflow commented May 8, 2017

i'm in favour of merging the Remove CYGWIN condition commit
from the bswap-check branch into the master branch.

the CYGWIN check in src/modbus-data.c in line 57 is not needed
and it makes not really sense, because the bswap_16 function
is not provided by CYGWIN. the bswap_16 function is provided
by gcc as __builtin_bswap16 . ggc provides its __builtin_bswap16
independet of CYGWIN, for example when MSYS is used instead of CYGWIN.

commit-history of the CYGWIN-check:
created/added in commit cb4d3ea
improved in commit 67cacf8

@stephane
Copy link
Owner

Merged. Thank you.

georgidimov pushed a commit to georgidimov/libmodbus that referenced this issue Jul 24, 2017
epsilonrt pushed a commit to epsilonrt/libmodbus that referenced this issue Jun 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants