Skip to content

Commit 442dea8

Browse files
authored
Merge pull request #185 from DenverM80/win_build_fix_print_uint64
Fix formatting of uint64_t print specifier macro and CMake config
2 parents 3f49677 + 776e277 commit 442dea8

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ add_library(ds3 SHARED
2525

2626
if (WIN32)
2727

28-
add_definitions(-DLIBRARY_EXPORTS -DCURL_STATICLIB -Dinline=__inline)
29-
set_property(TARGET ds3 PROPERTY _CRT_SECURE_NO_WARNINGS)
28+
add_definitions(-DLIBRARY_EXPORTS -DCURL_STATICLIB -Dinline=__inline -D__STDC_FORMAT_MACROS -D_CRT_SECURE_NO_WARNINGS)
3029
set_source_files_properties(ds3.c PROPERTIES LANGUAGE CXX)
3130

3231
file(TO_NATIVE_PATH "${PROJECT_SOURCE_DIR}/win32" WINDOWS_DIR)

src/ds3.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
#include <unistd.h>
4343
#endif
4444

45+
4546
#ifndef S_ISDIR
4647
#define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
4748
#endif
@@ -1157,7 +1158,7 @@ static void _set_query_param_flag(const ds3_request* _request, const char* key,
11571158
static void _set_query_param_uint64_t(const ds3_request* _request, const char* key, uint64_t value) {
11581159
char string_buffer[UNSIGNED_LONG_LONG_BASE_10_STR_LEN];
11591160
memset(string_buffer, 0, sizeof(string_buffer));
1160-
snprintf(string_buffer, sizeof(string_buffer), "%"PRIu64, value);
1161+
snprintf(string_buffer, sizeof(string_buffer), "%" PRIu64, value);
11611162
_set_query_param(_request, key, string_buffer);
11621163
}
11631164

@@ -3602,7 +3603,7 @@ static xmlDocPtr _generate_xml_bulk_objects_list(const ds3_bulk_object_list_resp
36023603

36033604
for (obj_index = 0; obj_index < obj_list->num_objects; obj_index++) {
36043605
obj = obj_list->objects[obj_index];
3605-
g_snprintf(size_buff, sizeof(char) * UNSIGNED_LONG_LONG_BASE_10_STR_LEN, "%"PRIu64, obj->length);
3606+
g_snprintf(size_buff, sizeof(char) * UNSIGNED_LONG_LONG_BASE_10_STR_LEN, "%" PRIu64, obj->length);
36063607

36073608
object_node = xmlNewNode(NULL, (xmlChar*) "Object");
36083609
xmlAddChild(objects_node, object_node);

src/ds3.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
#include "ds3_string_multimap.h"
3131

3232
#ifdef __cplusplus
33-
#define __STDC_FORMAT_MACROS
3433
extern "C" {
3534
#endif
3635

@@ -47,6 +46,7 @@ extern "C" {
4746

4847
#define DS3_READFUNC_ABORT CURL_READFUNC_ABORT
4948

49+
5050
typedef struct {
5151
int page_truncated;
5252
int total_result_count;

0 commit comments

Comments
 (0)