Skip to content

Commit 00bc338

Browse files
committed
COMMON: Fix 'Print #' on Windows to use Windows line endings
1 parent 2aa7814 commit 00bc338

File tree

10 files changed

+16
-10
lines changed

10 files changed

+16
-10
lines changed

ChangeLog

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2020-07-16 (12.19)
2+
COMMON: Fix 'Print #' on Windows to use Windows line endings
3+
14
2020-07-12 (12.19)
25
ANDROID: fix layout issue with samsung mobiles
36
ANDROID: save and restore the selected theme

src/common/blib.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ void cmd_print(int output) {
530530
if (code_peek() == kwTYPE_EOC || code_peek() == kwTYPE_LINE) {
531531
// There are no parameters
532532
if (dev_fstatus(handle)) {
533-
dev_fwrite(handle, (byte *) "\n", 1);
533+
dev_fwrite(handle, (byte *)OS_LINESEPARATOR, sizeof(OS_LINESEPARATOR));
534534
} else {
535535
err_fopen();
536536
}
@@ -642,7 +642,7 @@ void cmd_print(int output) {
642642
};
643643

644644
if (last_op == 0) {
645-
pv_write("\n", output, handle);
645+
pv_write(output == PV_FILE ? OS_LINESEPARATOR : "\n", output, handle);
646646
}
647647
}
648648

src/common/blib_db.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@ void cmd_fsaveln() {
725725
for (int i = 0; i < v_asize(array_p); i++) {
726726
var_p = v_elem(array_p, i);
727727
fprint_var(handle, var_p);
728-
dev_fwrite(handle, (byte *)"\n", 1);
728+
dev_fwrite(handle, (byte *)OS_LINESEPARATOR, sizeof(OS_LINESEPARATOR));
729729
}
730730
} else {
731731
// parameter is an string

src/common/sys.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@ extern "C" {
5454

5555
#if defined(_Win32)
5656
#define SB_VERSYS "Win"
57+
#define OS_LINESEPARATOR "\r\n"
5758
#else
5859
#define SB_VERSYS "Unix"
60+
#define OS_LINESEPARATOR "\r\n"
5961
#endif
6062

6163
#if UINTPTR_MAX == 0xffffffff

src/lib/miniaudio

src/platform/android/app/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ android {
88
defaultConfig {
99
applicationId 'net.sourceforge.smallbasic'
1010
minSdkVersion 16
11-
targetSdkVersion 29
12-
versionCode 39
13-
versionName "0.12.17"
11+
targetSdkVersion 28
12+
versionCode 40
13+
versionName "12.19"
1414
resConfigs "en"
1515
}
1616

src/platform/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
jcenter()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:4.0.0'
8+
classpath 'com.android.tools.build:gradle:4.0.1'
99
classpath "com.github.ben-manes:gradle-versions-plugin:0.22.0"
1010
}
1111
}

src/platform/android/jni/Android.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
JNI_PATH := $(call my-dir)
99
SB_HOME := $(JNI_PATH)/../../../..
10-
FREETYPE_HOME := $(HOME)/android-sdk/freetype-2.7.1
10+
FREETYPE_HOME := $(HOME)/android-sdk/freetype-2.10.2
1111

1212
include $(call all-subdir-makefiles)
1313
LOCAL_PATH := $(JNI_PATH)

src/platform/android/jni/freetype/Android.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ LOCAL_SRC_FILES:= \
2727
$(FREETYPE_HOME)/src/pcf/pcf.c \
2828
$(FREETYPE_HOME)/src/psaux/psaux.c \
2929
$(FREETYPE_HOME)/src/bdf/bdf.c \
30+
$(FREETYPE_HOME)/src/base/ftdebug.c \
3031
$(FREETYPE_HOME)/src/base/ftbbox.c \
3132
$(FREETYPE_HOME)/src/base/ftbitmap.c \
3233
$(FREETYPE_HOME)/src/base/ftglyph.c \

0 commit comments

Comments
 (0)