-
Notifications
You must be signed in to change notification settings - Fork 1.9k
build: CMake project fixes for MS Visual C++ compiler #11397
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
base: master
Are you sure you want to change the base?
Changes from all commits
77936dd
c502252
cdbce9f
121a772
f946525
0af0e46
6eb5fce
415b604
8eb67ef
b2f1ddb
e349a53
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,6 +18,7 @@ | |
| */ | ||
|
|
||
| #include <inttypes.h> | ||
| #include <limits.h> | ||
| #include <stdio.h> | ||
|
|
||
| #include <chunkio/chunkio_compat.h> | ||
|
|
@@ -76,6 +77,8 @@ int cio_file_native_map(struct cio_file *cf, size_t map_size) | |
| DWORD desired_access; | ||
| size_t file_size; | ||
| size_t actual_map_size; | ||
| DWORD actual_map_size_high; | ||
| DWORD actual_map_size_low; | ||
| int ret; | ||
|
|
||
| if (cf == NULL) { | ||
|
|
@@ -131,10 +134,18 @@ int cio_file_native_map(struct cio_file *cf, size_t map_size) | |
|
|
||
| /* CreateFileMappingA requires size as two DWORDs (high and low) */ | ||
| /* Use actual_map_size to ensure consistency */ | ||
| #if SIZE_MAX > MAXDWORD | ||
| actual_map_size_high = (DWORD)((actual_map_size >> (sizeof(DWORD) * CHAR_BIT)) | ||
| & 0xFFFFFFFFUL); | ||
| actual_map_size_low = (DWORD)(actual_map_size & 0xFFFFFFFFUL); | ||
| #else | ||
| actual_map_size_high = 0; | ||
| actual_map_size_low = (DWORD)actual_map_size; | ||
| #endif | ||
| cf->backing_mapping = CreateFileMappingA(cf->backing_file, NULL, | ||
| desired_protection, | ||
| (DWORD)(actual_map_size >> 32), | ||
| (DWORD)(actual_map_size & 0xFFFFFFFFUL), | ||
| actual_map_size_high, | ||
| actual_map_size_low, | ||
|
Comment on lines
21
to
+148
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you send your patch into fluent/cmetrics?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you mean fluent/chunkio?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| NULL); | ||
|
|
||
| if (cf->backing_mapping == NULL) { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.