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

[C] Windows fixes #861

Merged
merged 6 commits into from
Feb 19, 2020
Merged

[C] Windows fixes #861

merged 6 commits into from
Feb 19, 2020

Conversation

ltrzesniewski
Copy link
Contributor

Here's another round of Windows fixes for the media driver. See individual commit messages for details. The cleanup commit mostly gets rid of some warnings and makes the IDE happier.

There are still other things I'll need to fix though, I'll send the fixes later.

 - The buffer needs to be freed with LocalFree
 - Check the result of FormatMessageA
 - Use %s in case the error message contains a % character
aeron_unmap:
 - UnmapViewOfFile returns a nonzero value on success

aeron_is_directory:
 - Check for file attributes as flags
 - GetFileAttributes can return INVALID_FILE_ATTRIBUTES on error
 - It's not used anywhere, aeron_cmpxchg64 is used instead
 - The MSVC definition used GCC syntax so wouldn't compile if used
@@ -168,8 +168,14 @@ void aeron_set_windows_error()
0,
NULL);

aeron_set_err(errorId, messageBuffer);
free(messageBuffer);
if (result == 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

Formatting is a bit screwed here. Is there something missing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry, I inserted tabs here instead of spaces, will fix.

@@ -64,16 +64,6 @@ do \
} \
while (false)

#define AERON_CMPXCHG64(original, dst, expected, desired) \
Copy link
Contributor

Choose a reason for hiding this comment

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

Why remove this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  • It's not used anywhere, aeron_cmpxchg64 is used instead
  • The MSVC definition used GCC syntax so wouldn't compile if used

@@ -226,7 +226,7 @@ int aeron_udp_channel_transport_init(
if(set_socket_non_blocking(transport->fd) < 0)
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor point on formatting here. No space after if.

Copy link
Contributor Author

@ltrzesniewski ltrzesniewski Feb 19, 2020

Choose a reason for hiding this comment

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

Ok, I'll fix that in the next PR I see you've fixed it

@mjpt777 mjpt777 merged commit ea44c9f into real-logic:master Feb 19, 2020
@ltrzesniewski ltrzesniewski deleted the windows-fixes branch February 19, 2020 16:54
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

Successfully merging this pull request may close these issues.

2 participants