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

Avoid macro redefined warning #3861

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
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
30 changes: 29 additions & 1 deletion posixlib/src/main/resources/scala-native/unistd.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,40 @@
* prevent an application developer from getting the parts of an application
* which do not actually use the constants from running.
*/

#ifdef _XOPEN_VERSION
#undef _XOPEN_VERSION
#endif
#define _XOPEN_VERSION 0
Comment on lines +30 to 33
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess it would be better to keep original macro

Suggested change
#ifdef _XOPEN_VERSION
#undef _XOPEN_VERSION
#endif
#define _XOPEN_VERSION 0
#ifndef _XOPEN_VERSION
#define _XOPEN_VERSION 0
#endif

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure, because only part of constant are missed and all of them is switched of.

Let me ping @LeeTibbert as well.


#ifdef _PC_2_SYMLINKS
#undef _PC_2_SYMLINKS
#endif
#define _PC_2_SYMLINKS 0

#ifdef _SC_SS_REPL_MAX
#undef _SC_SS_REPL_MAX
#endif
#define _SC_SS_REPL_MAX 0

#ifdef _SC_TRACE_EVENT_NAME_MAX
#undef _SC_TRACE_EVENT_NAME_MAX
#endif
#define _SC_TRACE_EVENT_NAME_MAX 0

#ifdef _SC_TRACE_NAME_MAX
#undef _SC_TRACE_NAME_MAX
#endif
#define _SC_TRACE_NAME_MAX 0

#ifdef _SC_TRACE_SYS_MAX
#undef _SC_TRACE_SYS_MAX
#endif
#define _SC_TRACE_SYS_MAX 0

#ifdef _SC_TRACE_USER_EVENT_MAX
#undef _SC_TRACE_USER_EVENT_MAX
#endif
#define _SC_TRACE_USER_EVENT_MAX 0
#endif // __FreeBSD__ || __OpenBSD__ || __NetBSD__

Expand Down Expand Up @@ -584,4 +612,4 @@ int scalanative__sc_xopen_version() {
};

#endif // Unix or Mac OS
#endif
#endif