Skip to content

Commit 45c4f2f

Browse files
change base64 internal function name for avoiding symbol conflict at linking libraries.
1 parent 0d41ade commit 45c4f2f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Diff for: cocos/base/base64.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ namespace cocos2d {
3232

3333
unsigned char alphabet[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
3434

35-
int _base64Decode(const unsigned char *input, unsigned int input_len, unsigned char *output, unsigned int *output_len )
35+
int _ccBase64Decode(const unsigned char *input, unsigned int input_len, unsigned char *output, unsigned int *output_len )
3636
{
3737
static char inalphabet[256], decoder[256];
3838
int i, bits, c = 0, char_count, errors = 0;
@@ -95,7 +95,7 @@ int _base64Decode(const unsigned char *input, unsigned int input_len, unsigned c
9595
return errors;
9696
}
9797

98-
void _base64Encode( const unsigned char *input, unsigned int input_len, char *output )
98+
void _ccBase64Encode( const unsigned char *input, unsigned int input_len, char *output )
9999
{
100100
unsigned int char_count;
101101
unsigned int bits;
@@ -145,7 +145,7 @@ int base64Decode(const unsigned char *in, unsigned int inLength, unsigned char *
145145
//should be enough to store 6-bit buffers in 8-bit buffers
146146
*out = (unsigned char*)malloc(inLength / 4 * 3 + 1);
147147
if( *out ) {
148-
int ret = _base64Decode(in, inLength, *out, &outLength);
148+
int ret = _ccBase64Decode(in, inLength, *out, &outLength);
149149

150150
if (ret > 0 )
151151
{
@@ -166,7 +166,7 @@ int base64Encode(const unsigned char *in, unsigned int inLength, char **out) {
166166
//should be enough to store 8-bit buffers in 6-bit buffers
167167
*out = (char*)malloc(outLength+1);
168168
if( *out ) {
169-
_base64Encode(in, inLength, *out);
169+
_ccBase64Encode(in, inLength, *out);
170170
}
171171
return outLength;
172172
}

0 commit comments

Comments
 (0)