Skip to content

Commit 10d0884

Browse files
committed
Merge commit '64977e5aa21c6de22fd435ff96ce8eddcb57af40' into scgamex-v3
* commit '64977e5aa21c6de22fd435ff96ce8eddcb57af40': Support python 2 and 3 (cocos2d#20698) Update CCPlatformConfig.h (cocos2d#20693)
2 parents 0121d7d + 64977e5 commit 10d0884

File tree

2 files changed

+6
-16
lines changed

2 files changed

+6
-16
lines changed

cocos/platform/CCPlatformConfig.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ THE SOFTWARE.
5858
#define CC_TARGET_PLATFORM CC_PLATFORM_UNKNOWN
5959

6060
// Apple: Mac and iOS
61-
#if defined(__APPLE__) && !defined(ANDROID) // exclude android for binding generator.
61+
#if defined(__APPLE__) && !defined(__ANDROID__) // exclude android for binding generator.
6262
#include <TargetConditionals.h>
6363
#if TARGET_OS_IPHONE // TARGET_OS_IPHONE includes TARGET_OS_IOS TARGET_OS_TV and TARGET_OS_WATCH. see TargetConditionals.h
6464
#undef CC_TARGET_PLATFORM
@@ -72,7 +72,7 @@ THE SOFTWARE.
7272
#endif
7373

7474
// android
75-
#if defined(ANDROID)
75+
#if defined(__ANDROID__)
7676
#undef CC_TARGET_PLATFORM
7777
#define CC_TARGET_PLATFORM CC_PLATFORM_ANDROID
7878
#endif

download-deps.py

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,10 @@ def __init__(self, workpath, config_path, version_path, remote_version_key=None)
107107
print("==> version file doesn't exist")
108108

109109
def get_input_value(self, prompt):
110-
ret = raw_input(prompt)
110+
if sys.version_info[0] > 2:
111+
ret = input(prompt)
112+
else:
113+
ret = raw_input(prompt)
111114
ret.rstrip(" \t")
112115
return ret
113116

@@ -336,22 +339,9 @@ def run(self, workpath, folder_for_extracting, remove_downloaded, force_update,
336339
print("==> Download (%s) finish!" % self._filename)
337340

338341

339-
def _check_python_version():
340-
major_ver = sys.version_info[0]
341-
if major_ver > 2:
342-
print ("The python version is %d.%d. But python 2.x is required. (Version 2.7 is well tested)\n"
343-
"Download it here: https://www.python.org/" % (major_ver, sys.version_info[1]))
344-
return False
345-
346-
return True
347-
348-
349342
def main():
350343
workpath = os.path.dirname(os.path.realpath(__file__))
351344

352-
if not _check_python_version():
353-
exit()
354-
355345
parser = OptionParser()
356346
parser.add_option('-r', '--remove-download',
357347
action="store", type="string", dest='remove_downloaded', default=None,

0 commit comments

Comments
 (0)