Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Sep 7, 2021. It is now read-only.

Commit 315ebf3

Browse filesBrowse files
committed
Merge remote-tracking branch 'upstream/develop-9.6' into merge-develop-9.6_10_06_2021
2 parents f820b87 + 94ec39c commit 315ebf3
Copy full SHA for 315ebf3

22 files changed

+167
-111
lines changed
+29Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
Name: iphoneDeviceModel
2+
3+
Type: function
4+
5+
Syntax: iphoneDeviceModel()
6+
7+
Summary:
8+
Returns the machine name of the device the app is running on
9+
10+
11+
Introduced: 9.6.3
12+
13+
OS: ios
14+
15+
Platforms: mobile
16+
17+
Example:
18+
local tModel
19+
put iphoneDeviceModel() into tModel
20+
21+
22+
Description:
23+
Use the <iphoneDeviceModel> function to get the machine name of the device the app is running on
24+
25+
Note: The machine name is different from the full readable name of the device.
26+
You can find a mapping between these two names here: http://theiphonewiki.com/wiki/Models
27+
28+
29+

‎docs/notes/bugfix-16745.md

Copy file name to clipboard
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# An issue causing `$_POST_RAW` on Windows to not be set for large uploads has been fixed.

‎docs/notes/bugfix-21769.md

Copy file name to clipboard
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Added new function iphoneDeviceModel() that returns the machine name of the iOS device the app is running on

‎engine/bind-ios-standalone.sh

Copy file name to clipboardExpand all lines: engine/bind-ios-standalone.sh
+12-2Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
#!/bin/bash
22

3+
read SDK_MAJORVERSION SDK_MINORVERSION <<<${SDK_NAME//[^0-9]/ }
4+
35
set -e
46

57
case "$1" in
68
*-community.lcext)
7-
DEPS_FILE="${SRCROOT}/standalone.ios"
9+
if [[ $SDK_MAJORVERSION -lt 14 ]] ; then
10+
DEPS_FILE="${SRCROOT}/standalone.ios"
11+
else
12+
DEPS_FILE="${SRCROOT}/standalone14.ios"
13+
fi
814
;;
915
*-commercial.lcext)
10-
DEPS_FILE="${SRCROOT}/../livecode/engine/standalone.ios"
16+
if [[ $SDK_MAJORVERSION -lt 14 ]] ; then
17+
DEPS_FILE="${SRCROOT}/../livecode/engine/standalone.ios"
18+
else
19+
DEPS_FILE="${SRCROOT}/../livecode/engine/standalone14.ios"
20+
fi
1121
;;
1222
esac
1323

‎engine/engine.gyp

Copy file name to clipboardExpand all lines: engine/engine.gyp
+19-5Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -289,12 +289,26 @@
289289

290290
# Forces all dependencies to be linked properly
291291
'type': 'shared_library',
292+
293+
'conditions':
294+
[
295+
[
296+
'("11" not in target_sdk) and ("12" not in target_sdk) and ("13" not in target_sdk)',
297+
{
298+
'variables':
299+
{
300+
'deps_file': '${SRCROOT}/standalone14.ios',
301+
},
302+
},
303+
{
304+
'variables':
305+
{
306+
'deps_file': '${SRCROOT}/standalone.ios',
307+
},
308+
}
309+
],
310+
],
292311

293-
'variables':
294-
{
295-
'deps_file': '${SRCROOT}/standalone.ios',
296-
},
297-
298312
'xcode_settings':
299313
{
300314
'DEAD_CODE_STRIPPING': 'NO',

‎engine/kernel.gyp

Copy file name to clipboardExpand all lines: engine/kernel.gyp
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@
187187
},
188188
],
189189
[
190-
'OS == "ios" and target_sdk >= "14.0"',
190+
'OS == "ios" and ("11" not in target_sdk) and ("12" not in target_sdk) and ("13" not in target_sdk)',
191191
{
192192
'libraries':
193193
[

‎engine/rsrc/android-manifest.xml

Copy file name to clipboardExpand all lines: engine/rsrc/android-manifest.xml
+1-2Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,14 @@ ${USES_PERMISSION}${USES_FEATURE}
1313
android:normalScreens="true"
1414
android:smallScreens="true"
1515
android:anyDensity="true" />
16-
<application android:label="${LABEL}" ${ICON} android:debuggable="false">
16+
<application android:label="${LABEL}" ${ICON} android:debuggable="false" ${ALLOW_HTTP_CONNECTIONS}>
1717
<activity android:name="${NAME}"
1818
android:theme="${THEME}"
1919
android:screenOrientation="${ORIENTATION}"
2020
android:configChanges="${CONFIG_CHANGES}"
2121
android:windowSoftInputMode="stateHidden"
2222
android:launchMode="singleTask"
2323
android:hardwareAccelerated="${HARDWARE_ACCELERATED}">
24-
${ALLOW_HTTP_CONNECTIONS}
2524
<intent-filter>
2625
<action android:name="android.intent.action.MAIN" />
2726
<category android:name="android.intent.category.LAUNCHER" />

‎engine/src/exec-misc.cpp

Copy file name to clipboardExpand all lines: engine/src/exec-misc.cpp
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,14 @@ void MCMiscExecVibrate(MCExecContext& ctxt, int32_t* p_number_of_times)
117117
ctxt.Throw();
118118
}
119119

120+
void MCMiscGetDeviceModel(MCExecContext& ctxt, MCStringRef& r_model)
121+
{
122+
if(MCSystemGetDeviceModel(r_model))
123+
return;
124+
125+
ctxt.Throw();
126+
}
127+
120128
void MCMiscGetDeviceResolution(MCExecContext& ctxt, MCStringRef& r_resolution)
121129
{
122130
if(MCSystemGetDeviceResolution(r_resolution))

‎engine/src/exec.h

Copy file name to clipboardExpand all lines: engine/src/exec.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4017,6 +4017,7 @@ void MCMiscGetLaunchData(MCExecContext &ctxt, MCArrayRef &r_data);
40174017
void MCMiscExecBeep(MCExecContext& ctxt, int32_t* p_number_of_times);
40184018
void MCMiscExecVibrate(MCExecContext& ctxt, int32_t* p_number_of_times);
40194019

4020+
void MCMiscGetDeviceModel(MCExecContext& ctxt, MCStringRef& r_model);
40204021
void MCMiscGetDeviceResolution(MCExecContext& ctxt, MCStringRef& r_resolution);
40214022
void MCMiscSetUseDeviceResolution(MCExecContext& ctxt, bool p_use_device_res, bool p_use_control_device_res);
40224023
void MCMiscGetDeviceScale(MCExecContext& ctxt, real64_t& r_scale);

‎engine/src/mblandroidmisc.cpp

Copy file name to clipboardExpand all lines: engine/src/mblandroidmisc.cpp
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,12 @@ bool MCSystemGetPixelDensity(real64_t& r_density)
655655

656656
////////////////////////////////////////////////////////////////////////////////
657657

658+
bool MCSystemGetDeviceModel(MCStringRef& p_model)
659+
{
660+
// Not implemented
661+
return false;
662+
}
663+
658664
bool MCSystemGetDeviceResolution(MCStringRef& p_resolution)
659665
{
660666
// Not implemented

‎engine/src/mblhandlers.cpp

Copy file name to clipboardExpand all lines: engine/src/mblhandlers.cpp
+18Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2840,6 +2840,23 @@ Exec_stat MCHandleVibrate(void *p_context, MCParameter *p_parameters)
28402840
return ES_ERROR;
28412841
}
28422842

2843+
Exec_stat MCHandleDeviceModel(void *context, MCParameter *p_parameters)
2844+
{
2845+
MCExecContext ctxt(nil, nil, nil);
2846+
2847+
MCAutoStringRef t_device_model;
2848+
MCMiscGetDeviceModel(ctxt, &t_device_model);
2849+
2850+
if (!ctxt.HasError())
2851+
{
2852+
ctxt.SetTheResultToValue(*t_device_model);
2853+
return ES_NORMAL;
2854+
}
2855+
2856+
ctxt.SetTheResultToEmpty();
2857+
return ES_ERROR;
2858+
}
2859+
28432860
Exec_stat MCHandleDeviceResolution(void *context, MCParameter *p_parameters)
28442861
{
28452862
MCExecContext ctxt(nil, nil, nil);
@@ -4707,6 +4724,7 @@ static const MCPlatformMessageSpec s_platform_messages[] =
47074724
{false, "mobileSetKeyboardType", MCHandleSetKeyboardType, nil},
47084725
{false, "mobileSetKeyboardReturnKey", MCHandleSetKeyboardReturnKey, nil}, // Added from androidmisc.cpp
47094726

4727+
{false, "iphoneDeviceModel", MCHandleDeviceModel, nil},
47104728
{false, "iphoneDeviceResolution", MCHandleDeviceResolution, nil},
47114729
{false, "iphoneUseDeviceResolution", MCHandleUseDeviceResolution, nil},
47124730
{false, "iphoneDeviceScale", MCHandleDeviceScale, nil},

‎engine/src/mbliphoneapp.mm

Copy file name to clipboardExpand all lines: engine/src/mbliphoneapp.mm
+1-60Lines changed: 1 addition & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1706,66 +1706,7 @@ - (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection
17061706

17071707
NSString *t_machine_name = [NSString stringWithCString:t_system_info.machine encoding:NSUTF8StringEncoding];
17081708

1709-
// MARK: We can just return t_machine_name. Following is for convenience
1710-
// Full list at http://theiphonewiki.com/wiki/Models
1711-
1712-
NSDictionary *commonNamesDictionary = [NSDictionary dictionaryWithObjectsAndKeys:
1713-
@"iPhone", @"iPhone1,1",
1714-
@"iPhone 3G", @"iPhone1,2",
1715-
@"iPhone 3GS", @"iPhone2,1",
1716-
@"iPhone 4", @"iPhone3,1",
1717-
1718-
@"iPhone 4(Rev A)", @"iPhone3,2",
1719-
@"iPhone 4(CDMA)", @"iPhone3,3",
1720-
@"iPhone 4S", @"iPhone4,1",
1721-
@"iPhone 5(GSM)", @"iPhone5,1",
1722-
@"iPhone 5(GSM+CDMA)", @"iPhone5,2",
1723-
@"iPhone 5c(GSM)", @"iPhone5,3",
1724-
@"iPhone 5c(GSM+CDMA)", @"iPhone5,4",
1725-
@"iPhone 5s(GSM)", @"iPhone6,1",
1726-
@"iPhone 5s(GSM+CDMA)", @"iPhone6,2",
1727-
1728-
@"iPhone 6+ (GSM+CDMA)", @"iPhone7,1",
1729-
@"iPhone 6 (GSM+CDMA)", @"iPhone7,2",
1730-
1731-
@"iPad", @"iPad1,1",
1732-
@"iPad 2(WiFi)", @"iPad2,1",
1733-
@"iPad 2(GSM)", @"iPad2,2",
1734-
@"iPad 2(CDMA)", @"iPad2,3",
1735-
@"iPad 2(WiFi Rev A)", @"iPad2,4",
1736-
@"iPad Mini 1G (WiFi)", @"iPad2,5",
1737-
@"iPad Mini 1G (GSM)", @"iPad2,6",
1738-
@"iPad Mini 1G (GSM+CDMA)", @"iPad2,7",
1739-
@"iPad 3(WiFi)", @"iPad3,1",
1740-
@"iPad 3(GSM+CDMA)", @"iPad3,2",
1741-
@"iPad 3(GSM)", @"iPad3,3",
1742-
@"iPad 4(WiFi)", @"iPad3,4",
1743-
@"iPad 4(GSM)", @"iPad3,5",
1744-
@"iPad 4(GSM+CDMA)", @"iPad3,6",
1745-
1746-
@"iPad Air(WiFi)", @"iPad4,1",
1747-
@"iPad Air(GSM)", @"iPad4,2",
1748-
@"iPad Air(GSM+CDMA)", @"iPad4,3",
1749-
1750-
@"iPad Mini 2G (WiFi)", @"iPad4,4",
1751-
@"iPad Mini 2G (GSM)", @"iPad4,5",
1752-
@"iPad Mini 2G (GSM+CDMA)", @"iPad4,6",
1753-
1754-
@"iPod 1st Gen", @"iPod1,1",
1755-
@"iPod 2nd Gen", @"iPod2,1",
1756-
@"iPod 3rd Gen", @"iPod3,1",
1757-
@"iPod 4th Gen", @"iPod4,1",
1758-
@"iPod 5th Gen", @"iPod5,1",
1759-
// PM-2015-03-03: [[ Bug 14689 ]] Cast to NSString* to prevent EXC_BAD_ACCESS when in release mode and run in 64bit device/sim
1760-
(NSString *)nil];
1761-
1762-
1763-
NSString *t_device_name = [commonNamesDictionary objectForKey: t_machine_name];
1764-
1765-
if (t_device_name == nil)
1766-
t_device_name = t_machine_name;
1767-
1768-
return t_device_name;
1709+
return t_machine_name;
17691710
}
17701711

17711712
MCIPhoneApplication *MCIPhoneGetApplication(void)

‎engine/src/mbliphoneextra.mm

Copy file name to clipboardExpand all lines: engine/src/mbliphoneextra.mm
+7Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -581,6 +581,13 @@ bool MCSystemVibrate (int32_t p_number_of_vibrates)
581581

582582
/////////////////////////////////////////////////////////////////////////////////////////////////////
583583

584+
bool MCSystemGetDeviceModel(MCStringRef& r_model)
585+
{
586+
NSString *t_device_model_name = MCIPhoneGetDeviceModelName();
587+
588+
return MCStringCreateWithCFStringRef((CFStringRef)t_device_model_name, r_model);
589+
}
590+
584591
bool MCSystemGetDeviceResolution(MCStringRef& p_resolution)
585592
{
586593
UIScreenMode *t_mode;

‎engine/src/mbliphonepick.mm

Copy file name to clipboardExpand all lines: engine/src/mbliphonepick.mm
-5Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -505,11 +505,6 @@ - (void) startPicking: (NSArray *)p_pickerOptions andInitial: (NSArray *)p_initi
505505
m_bar_visible = true;
506506
}
507507

508-
// PM-2014-10-22: [[ Bug 13750 ]] Make sure the view under the pickerView is not visible (iphone 4 only)
509-
NSString *t_device_model_name = MCIPhoneGetDeviceModelName();
510-
if ([t_device_model_name isEqualToString:@"iPhone 4"] || [t_device_model_name isEqualToString:@"iPhone 4(Rev A)"] || [t_device_model_name isEqualToString:@"iPhone 4(CDMA)"])
511-
pickerView.backgroundColor = [UIColor colorWithWhite:1.0 alpha:0.90];
512-
513508
// set the label item
514509
for (t_i = 0; t_i < [m_selected_index count]; t_i++)
515510
[pickerView selectRow:[[m_selected_index objectAtIndex:t_i] integerValue] inComponent:t_i animated:NO];

‎engine/src/mbliphonepickdate.mm

Copy file name to clipboardExpand all lines: engine/src/mbliphonepickdate.mm
+1-4Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,16 +251,13 @@ - (void) startDatePicker:(NSString *)p_style andCurrent: (int32_t)r_current andS
251251
[datePicker setLocale:t_locale];
252252
[datePicker setCalendar:[t_locale objectForKey:NSLocaleCalendar]];
253253
[datePicker setTimeZone:[NSTimeZone localTimeZone]];
254+
254255
#ifdef __IPHONE_14_0
255256
if (@available(iOS 14, *))
256257
{
257258
[datePicker setPreferredDatePickerStyle: UIDatePickerStyleWheels];
258259
}
259260
#endif
260-
// PM-2014-10-22: [[ Bug 13750 ]] Make sure the view under the pickerView is not visible (iphone 4 only)
261-
NSString *t_device_model_name = MCIPhoneGetDeviceModelName();
262-
if ([t_device_model_name isEqualToString:@"iPhone 4"] || [t_device_model_name isEqualToString:@"iPhone 4(Rev A)"] || [t_device_model_name isEqualToString:@"iPhone 4(CDMA)"])
263-
datePicker.backgroundColor = [UIColor colorWithWhite:1.0 alpha:0.90];
264261

265262
// set up the style and parameters for the date picker
266263
if (p_style == nil || MCCStringEqual([p_style cStringUsingEncoding:NSMacOSRomanStringEncoding], "dateTime"))

‎engine/src/mblsyntax.h

Copy file name to clipboardExpand all lines: engine/src/mblsyntax.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,7 @@ bool MCSystemGetLaunchData(MCArrayRef &r_lauch_data);
432432
bool MCSystemBeep(int32_t p_number_of_times);
433433
bool MCSystemVibrate(int32_t p_number_of_times);
434434

435+
bool MCSystemGetDeviceModel(MCStringRef& r_model);
435436
bool MCSystemGetDeviceResolution(MCStringRef& p_resolution);
436437
bool MCSystemGetPixelDensity(real64_t& r_density);
437438
bool MCSystemSetDeviceUseResolution(bool p_use_device_res, bool p_use_control_device_res);

‎engine/src/srvcgi.cpp

Copy file name to clipboardExpand all lines: engine/src/srvcgi.cpp
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -993,10 +993,16 @@ static bool cgi_compute_post_raw_var(void *p_context, MCVariable *p_var)
993993
t_length = atoi(MCStringGetCString(*t_content_length));
994994

995995
uint32_t t_read = 0;
996+
uint32_t t_offset = 0;
996997

997998
char *t_data;
998999
t_data = new (nothrow) char[t_length];
999-
t_success = t_stdin->Read(t_data, t_length, t_read) && t_length == t_read;
1000+
while (t_stdin->Read(t_data, t_length - t_offset, t_read) && t_offset < t_length)
1001+
{
1002+
/* read until length satisfied */
1003+
t_offset += t_read;
1004+
}
1005+
t_success = t_length == t_offset;
10001006

10011007
// Store the raw POST data
10021008
if (t_success)

‎engine/src/srvwindows.cpp

Copy file name to clipboardExpand all lines: engine/src/srvwindows.cpp
+8-24Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,28 +1241,18 @@ bool MCS_get_temporary_folder(MCStringRef &r_temp_folder)
12411241

12421242
bool MCS_create_temporary_file(MCStringRef p_path_string, MCStringRef p_prefix_string, IO_handle &r_file, MCStringRef &r_name_string)
12431243
{
1244-
const char *t_path = MCStringGetCString(p_path_string);
1245-
const char *t_prefix = MCStringGetCString(p_prefix_string);
1246-
char *t_name = (char*)MCStringGetCString(r_name_string);
1247-
12481244
bool t_success = true;
1249-
bool t_have_file = false;
12501245

1251-
char *t_temp_file = NULL;
12521246
GUID t_guid;
12531247
WCHAR *t_guid_utf16 = NULL;
12541248

1255-
HANDLE t_temp_handle = NULL;
1249+
IO_handle t_temp_handle = NULL;
12561250

1257-
while (t_success && !t_have_file)
1251+
MCAutoStringRef t_temp_file;
1252+
while (t_success && t_temp_handle == NULL)
12581253
{
12591254
CoCreateGuid(&t_guid);
12601255

1261-
if (t_temp_file != NULL)
1262-
{
1263-
MCCStringFree(t_temp_file);
1264-
t_temp_file = NULL;
1265-
}
12661256
if (t_guid_utf16 != NULL)
12671257
{
12681258
CoTaskMemFree(t_guid_utf16);
@@ -1277,28 +1267,22 @@ bool MCS_create_temporary_file(MCStringRef p_path_string, MCStringRef p_prefix_s
12771267
for (i = 0; t_guid_utf16[i] != '\0'; i++)
12781268
t_guid_string[i] = t_guid_utf16[i] & 0xFF;
12791269
t_guid_string[i] = '\0';
1280-
t_success = MCCStringFormat(t_temp_file, "%s/%s%s", t_path, t_prefix, t_guid_string);
1270+
t_success = MCStringFormat(&t_temp_file, "%@/%@%s", p_path_string, p_prefix_string, t_guid_string);
12811271
}
12821272

12831273
if (t_success)
12841274
{
1285-
t_temp_handle = CreateFileA(t_temp_file, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
1286-
if (t_temp_handle != INVALID_HANDLE_VALUE)
1287-
t_have_file = true;
1288-
else
1275+
t_temp_handle = MCsystem->OpenFile(*t_temp_file, (intenum_t)kMCOpenFileModeCreate, false);
1276+
if (t_temp_handle == NULL)
12891277
t_success = GetLastError() == ERROR_FILE_EXISTS;
12901278
}
12911279
}
12921280

12931281
if (t_success)
12941282
{
1295-
r_file = MCsystem -> OpenFd(_open_osfhandle((intptr_t)t_temp_handle, _O_RDWR), kMCOpenFileModeCreate);
1296-
t_name = t_temp_file;
1297-
/* UNCHECKED */ MCStringCreateWithCString(t_name, r_name_string);
1298-
1283+
r_file = t_temp_handle;
1284+
r_name_string = t_temp_file.Take();
12991285
}
1300-
else
1301-
MCCStringFree(t_temp_file);
13021286

13031287
CoTaskMemFree(t_guid_utf16);
13041288
return t_success;

‎engine/standalone.ios

Copy file name to clipboardExpand all lines: engine/standalone.ios
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,3 @@ framework EventKit
2222
framework EventKitUI
2323
framework Security
2424
framework WebKit
25-
framework AppTrackingTransparency

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.