Skip to content

Commit 817c05d

Browse files
committed
Fix zlib issues (#28)
* create internal compression component * use the new miniz code * Update README.md
1 parent b6c8168 commit 817c05d

File tree

3 files changed

+11
-17
lines changed

3 files changed

+11
-17
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ Example:
123123
Example:
124124

125125
``` c++
126-
gameanalytics::GameAnalytics::initialize("<your game key>", "<your secret key");
126+
gameanalytics::GameAnalytics::initialize("<your game key>", "<your secret key>");
127127
```
128128
129129
### Send events
Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -219,9 +219,9 @@
219219
#define MINIZ_HAS_64BIT_REGISTERS 1
220220
#endif
221221

222-
#ifdef __cplusplus
223-
extern "C" {
224-
#endif
222+
namespace gameanalytics {
223+
namespace utilities {
224+
namespace zip {
225225

226226
// ------------------- zlib-style API Definitions.
227227

@@ -919,10 +919,6 @@ mz_uint32 tdefl_get_adler32(tdefl_compressor *d);
919919
mz_uint tdefl_create_comp_flags_from_zip_params(int level, int window_bits, int strategy);
920920
#endif // #ifndef MINIZ_NO_ZLIB_APIS
921921

922-
#ifdef __cplusplus
923-
}
924-
#endif
925-
926922
#endif // MINIZ_HEADER_INCLUDED
927923

928924
// ------------------- End of Header: Implementation follows. (If you only want the header, define MINIZ_HEADER_FILE_ONLY.)
@@ -968,10 +964,6 @@ typedef unsigned char mz_validate_uint64[sizeof(mz_uint64)==8 ? 1 : -1];
968964
#define MZ_FORCEINLINE inline
969965
#endif
970966

971-
#ifdef __cplusplus
972-
extern "C" {
973-
#endif
974-
975967
// ------------------- zlib-style API's
976968

977969
mz_ulong mz_adler32(mz_ulong adler, const unsigned char *ptr, size_t buf_len)
@@ -4882,12 +4874,12 @@ void *mz_zip_extract_archive_file_to_heap(const char *pZip_filename, const char
48824874

48834875
#endif // #ifndef MINIZ_NO_ARCHIVE_APIS
48844876

4885-
#ifdef __cplusplus
4886-
}
4887-
#endif
4888-
48894877
#endif // MINIZ_HEADER_FILE_ONLY
48904878

4879+
} // namespace zip
4880+
} // namespace utilities
4881+
} // namespace gameanalytics
4882+
48914883
/*
48924884
This is free and unencumbered software released into the public domain.
48934885

source/gameanalytics/GAUtilities.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,14 @@
2020

2121
// From crypto
2222
#define MINIZ_HEADER_FILE_ONLY
23-
#include "miniz.c"
23+
#include "GA_Zip.cpp"
2424

2525
namespace gameanalytics
2626
{
2727
namespace utilities
2828
{
29+
using namespace zip;
30+
2931
std::string printArray(StringVector const& v, std::string const& delim)
3032
{
3133
if(v.empty())

0 commit comments

Comments
 (0)