From dbd3fce0a57ce80b4f075c202d1f2666ac25620e Mon Sep 17 00:00:00 2001 From: "Huabing.Xu" Date: Tue, 15 Jul 2014 13:54:08 +0800 Subject: [PATCH] windows dll version of cpp-tests works --- cocos/3d/CCSprite3D.h | 2 +- cocos/base/base64.cpp | 4 ++-- cocos/base/base64.h | 6 ++++-- cocos/base/ccUTF8.h | 16 ++++++++-------- cocos/ui/CCProtectedNode.h | 2 +- 5 files changed, 16 insertions(+), 14 deletions(-) diff --git a/cocos/3d/CCSprite3D.h b/cocos/3d/CCSprite3D.h index 4772a5bd00..fdab102c30 100644 --- a/cocos/3d/CCSprite3D.h +++ b/cocos/3d/CCSprite3D.h @@ -94,7 +94,7 @@ protected: BlendFunc _blend; }; -extern std::string s_attributeNames[];//attribute names array +extern std::string CC_DLL s_attributeNames[];//attribute names array NS_CC_END #endif // __SPRITE3D_H_ diff --git a/cocos/base/base64.cpp b/cocos/base/base64.cpp index f697c1cb2f..5e7b7ef0de 100644 --- a/cocos/base/base64.cpp +++ b/cocos/base/base64.cpp @@ -68,7 +68,7 @@ int _base64Decode(const unsigned char *input, unsigned int input_len, unsigned c switch (char_count) { case 1: #if (CC_TARGET_PLATFORM != CC_PLATFORM_BADA) - std::fprintf(stderr, "base64Decode: encoding incomplete: at least 2 bits missing"); + fprintf(stderr, "base64Decode: encoding incomplete: at least 2 bits missing"); #endif errors++; break; @@ -83,7 +83,7 @@ int _base64Decode(const unsigned char *input, unsigned int input_len, unsigned c } else if ( input_idx < input_len ) { if (char_count) { #if (CC_TARGET_PLATFORM != CC_PLATFORM_BADA) - std::fprintf(stderr, "base64 encoding incomplete: at least %d bits truncated", + fprintf(stderr, "base64 encoding incomplete: at least %d bits truncated", ((4 - char_count) * 6)); #endif errors++; diff --git a/cocos/base/base64.h b/cocos/base/base64.h index 67149d78ed..1180c365ce 100644 --- a/cocos/base/base64.h +++ b/cocos/base/base64.h @@ -26,6 +26,8 @@ THE SOFTWARE. #ifndef __SUPPORT_BASE64_H__ #define __SUPPORT_BASE64_H__ +#include "base/CCPlatformMacros.h" + #ifdef __cplusplus extern "C" { #endif @@ -44,7 +46,7 @@ namespace cocos2d { * @since v0.8.1 */ -int base64Decode(const unsigned char *in, unsigned int inLength, unsigned char **out); +int CC_DLL base64Decode(const unsigned char *in, unsigned int inLength, unsigned char **out); /** * Encodes bytes into a 64base encoded memory with terminating '\0' character. @@ -54,7 +56,7 @@ int base64Decode(const unsigned char *in, unsigned int inLength, unsigned char * * @since v2.1.4 */ -int base64Encode(const unsigned char *in, unsigned int inLength, char **out); +int CC_DLL base64Encode(const unsigned char *in, unsigned int inLength, char **out); }//namespace cocos2d diff --git a/cocos/base/ccUTF8.h b/cocos/base/ccUTF8.h index 87760db047..f9561efa09 100644 --- a/cocos/base/ccUTF8.h +++ b/cocos/base/ccUTF8.h @@ -133,7 +133,7 @@ CC_DEPRECATED_ATTRIBUTE CC_DLL int cc_wcslen(const unsigned short* str); * @deprecated Please use `StringUtils::trimUTF16Vector` instead */ -CC_DEPRECATED_ATTRIBUTE void cc_utf8_trim_ws(std::vector* str); +CC_DEPRECATED_ATTRIBUTE CC_DLL void cc_utf8_trim_ws(std::vector* str); /** * Whether the character is a whitespace character. @@ -144,7 +144,7 @@ CC_DEPRECATED_ATTRIBUTE void cc_utf8_trim_ws(std::vector* str); * * @see http://en.wikipedia.org/wiki/Whitespace_character#Unicode * */ -CC_DEPRECATED_ATTRIBUTE bool isspace_unicode(unsigned short ch); +CC_DEPRECATED_ATTRIBUTE CC_DLL bool isspace_unicode(unsigned short ch); /** * Whether the character is a Chinese/Japanese/Korean character. @@ -156,7 +156,7 @@ CC_DEPRECATED_ATTRIBUTE bool isspace_unicode(unsigned short ch); * @see http://www.searchtb.com/2012/04/chinese_encode.html * @see http://tieba.baidu.com/p/748765987 * */ -CC_DEPRECATED_ATTRIBUTE bool iscjk_unicode(unsigned short ch); +CC_DEPRECATED_ATTRIBUTE CC_DLL bool iscjk_unicode(unsigned short ch); /** * Returns the length of the string in characters. @@ -166,7 +166,7 @@ CC_DEPRECATED_ATTRIBUTE bool iscjk_unicode(unsigned short ch); * @deprecated Please use `StringUtils::getCharacterCountInUTF8String` instead * @returns the length of the string in characters **/ -CC_DEPRECATED_ATTRIBUTE long cc_utf8_strlen (const char * p, int max = -1); +CC_DEPRECATED_ATTRIBUTE CC_DLL long cc_utf8_strlen (const char * p, int max = -1); /** * Find the last character that is not equal to the character given. @@ -176,13 +176,13 @@ CC_DEPRECATED_ATTRIBUTE long cc_utf8_strlen (const char * p, int max = -1); * @deprecated Please use `StringUtils::getIndexOfLastNotChar16` instead * @returns the index of the last character that is not \p c. * */ -CC_DEPRECATED_ATTRIBUTE unsigned int cc_utf8_find_last_not_char(const std::vector& str, unsigned short c); +CC_DEPRECATED_ATTRIBUTE CC_DLL unsigned int cc_utf8_find_last_not_char(const std::vector& str, unsigned short c); /** * @brief Gets `unsigned short` vector from a given utf16 string * @deprecated Please use `StringUtils::getChar16VectorFromUTF16String` instead */ -CC_DEPRECATED_ATTRIBUTE std::vector cc_utf16_vec_from_utf16_str(const unsigned short* str); +CC_DEPRECATED_ATTRIBUTE CC_DLL std::vector cc_utf16_vec_from_utf16_str(const unsigned short* str); /** * Creates an utf8 string from a c string. The result will be null terminated. @@ -194,7 +194,7 @@ CC_DEPRECATED_ATTRIBUTE std::vector cc_utf16_vec_from_utf16_str( * @returns the newly created utf16 string, it must be released with `delete[]`, * If an error occurs, %NULL will be returned. * */ -CC_DEPRECATED_ATTRIBUTE unsigned short* cc_utf8_to_utf16(const char* str_old, int length = -1, int* rUtf16Size = nullptr); +CC_DEPRECATED_ATTRIBUTE CC_DLL unsigned short* cc_utf8_to_utf16(const char* str_old, int length = -1, int* rUtf16Size = nullptr); /** * Converts a string from UTF-16 to UTF-8. The result will be null terminated. @@ -207,7 +207,7 @@ CC_DEPRECATED_ATTRIBUTE unsigned short* cc_utf8_to_utf16(const char* str_old, in * @returns a pointer to a newly allocated UTF-8 string. This value must be * released with `delete[]`. If an error occurs, %NULL will be returned. **/ -CC_DEPRECATED_ATTRIBUTE char * cc_utf16_to_utf8 (const unsigned short *str, +CC_DEPRECATED_ATTRIBUTE CC_DLL char * cc_utf16_to_utf8 (const unsigned short *str, int len = -1, long *items_read = nullptr, long *items_written = nullptr); diff --git a/cocos/ui/CCProtectedNode.h b/cocos/ui/CCProtectedNode.h index c950c5da2b..bd54dce028 100644 --- a/cocos/ui/CCProtectedNode.h +++ b/cocos/ui/CCProtectedNode.h @@ -34,7 +34,7 @@ NS_CC_BEGIN -class CC_DLL ProtectedNode : public Node +class ProtectedNode : public Node { public: static ProtectedNode * create(void);