Skip to content

Commit

Permalink
Enhanced compatibility with Windows 11: Introduced the winconsole pro…
Browse files Browse the repository at this point in the history
…ject to ensure the console version of nuBASIC functions correctly under the new OS environment.
  • Loading branch information
antonino-nt committed Jan 7, 2024
1 parent 9e5592e commit c5bc6fc
Show file tree
Hide file tree
Showing 17 changed files with 563 additions and 25 deletions.
6 changes: 3 additions & 3 deletions config.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
#define PACKAGE_NAME "nubasic"

/* Define to the full name and version of this package. */
#define PACKAGE_STRING "nubasic 1.52"
#define PACKAGE_STRING "nubasic 1.53"

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "nubasic"
Expand All @@ -83,13 +83,13 @@
#define PACKAGE_URL ""

/* Define to the version of this package. */
#define PACKAGE_VERSION "1.52"
#define PACKAGE_VERSION "1.53"

/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1

/* Version number of package */
#define VERSION "1.52"
#define VERSION "1.53"

/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
Expand Down
9 changes: 2 additions & 7 deletions include/nu_about.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

/* -------------------------------------------------------------------------- */

#ifndef __NU_ABOUT_H__
#define __NU_ABOUT_H__
#pragma once


/* -------------------------------------------------------------------------- */
Expand All @@ -36,7 +35,7 @@ namespace about {
static const char* const homepage = "http://www.nubasic.eu";
static const char* const license = "The MIT License (MIT)";
static const char* const version = PACKAGE_VERSION;
static const char* const copyright = "2014-2022";
static const char* const copyright = "2014-2024";
static const char* const description
= "nuBASIC is a programming language from the BASIC family.\n"
"nuBASIC has been written in C++ and distributed under MIT License."
Expand All @@ -53,8 +52,4 @@ namespace about {
}


/* -------------------------------------------------------------------------- */

#endif // __NU_ABOUT_H__

/* -------------------------------------------------------------------------- */
5 changes: 1 addition & 4 deletions include/nu_variant.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@

/* -------------------------------------------------------------------------- */

#ifndef __NU_VARIANT_H__
#define __NU_VARIANT_H__
#pragma once


/* -------------------------------------------------------------------------- */
Expand Down Expand Up @@ -422,5 +421,3 @@ class variant_t {


/* -------------------------------------------------------------------------- */

#endif // __NU_VARIANT_H__
15 changes: 6 additions & 9 deletions main.cc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
//
//
// This file is part of nuBASIC
// Copyright (c) Antonino Calderone ([email protected])
// All rights reserved.
// Licensed under the MIT License.
// All rights reserved.
// Licensed under the MIT License.
// See COPYING file in the project root for full license information.
//

Expand All @@ -13,9 +13,8 @@
#include "nu_interpreter.h"
#include "nu_os_console.h"
#include "nu_os_std.h"
#include "nu_terminal_frame.h"
#include "nu_reserved_keywords.h"

#include "nu_terminal_frame.h"

#include <cassert>
#include <iostream>
Expand All @@ -26,10 +25,10 @@
#include <variant>

#ifdef WIN32
#pragma message("Warning: Use winconsole project to build command line version of nuBASIC, which is compatible with Windows 11")
#include <Windows.h>
#endif


/* -------------------------------------------------------------------------- */

static nu::interpreter_t::exec_res_t exec_command(
Expand All @@ -47,7 +46,7 @@ static nu::interpreter_t::exec_res_t exec_command(
basic.get_cur_line_n());
else if (res == nu::interpreter_t::exec_res_t::STOP_REQ)
printf("Execution stopped at STOP instruction, line %i.\n"
"Type 'cont' to continue\n",
"Type 'cont' to continue\n",
basic.get_cur_line_n());
return res;
}
Expand Down Expand Up @@ -80,7 +79,6 @@ static nu::interpreter_t::exec_res_t exec_command(
return nu::interpreter_t::exec_res_t::CMD_EXEC;
}


/* -------------------------------------------------------------------------- */

static int nuBASIC_console(int argc, char* argv[])
Expand Down Expand Up @@ -195,7 +193,6 @@ static int nuBASIC_console(int argc, char* argv[])
return 0;
}


/* -------------------------------------------------------------------------- */

int main(int argc, char* argv[])
Expand Down
14 changes: 12 additions & 2 deletions nubasic.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26228.9
# Visual Studio Version 17
VisualStudioVersion = 17.6.34302.98
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nubasic", "nubasic.vcxproj", "{E0C5DA15-A4C6-4FB4-BAC6-92DEB60B6B49}"
ProjectSection(ProjectDependencies) = postProject
Expand All @@ -15,6 +15,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NuBasicIDE", "ide\win\nuBas
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "interpreter", "lib\win\interpreter.vcxproj", "{9622E9B4-A6E2-474F-804F-241C8AC419CF}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "winconsole", "winconsole\winconsole.vcxproj", "{8A85877F-8A47-49DE-8308-929CC10C8F02}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Expand Down Expand Up @@ -47,6 +49,14 @@ Global
{9622E9B4-A6E2-474F-804F-241C8AC419CF}.Release|x64.Build.0 = Release|x64
{9622E9B4-A6E2-474F-804F-241C8AC419CF}.Release|x86.ActiveCfg = Release|Win32
{9622E9B4-A6E2-474F-804F-241C8AC419CF}.Release|x86.Build.0 = Release|Win32
{8A85877F-8A47-49DE-8308-929CC10C8F02}.Debug|x64.ActiveCfg = Debug|x64
{8A85877F-8A47-49DE-8308-929CC10C8F02}.Debug|x64.Build.0 = Debug|x64
{8A85877F-8A47-49DE-8308-929CC10C8F02}.Debug|x86.ActiveCfg = Debug|Win32
{8A85877F-8A47-49DE-8308-929CC10C8F02}.Debug|x86.Build.0 = Debug|Win32
{8A85877F-8A47-49DE-8308-929CC10C8F02}.Release|x64.ActiveCfg = Release|x64
{8A85877F-8A47-49DE-8308-929CC10C8F02}.Release|x64.Build.0 = Release|x64
{8A85877F-8A47-49DE-8308-929CC10C8F02}.Release|x86.ActiveCfg = Release|Win32
{8A85877F-8A47-49DE-8308-929CC10C8F02}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
30 changes: 30 additions & 0 deletions winconsole/Resource.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by winconsole.rc

#define IDS_APP_TITLE 103

#define IDR_MAINFRAME 128
#define IDD_WINCONSOLE_DIALOG 102
#define IDD_ABOUTBOX 103
#define IDM_ABOUT 104
#define IDM_EXIT 105
#define IDI_WINCONSOLE 107
#define IDI_SMALL 108
#define IDC_WINCONSOLE 109
#define IDC_MYICON 2
#ifndef IDC_STATIC
#define IDC_STATIC -1
#endif
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS

#define _APS_NO_MFC 130
#define _APS_NEXT_RESOURCE_VALUE 129
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1000
#define _APS_NEXT_SYMED_VALUE 110
#endif
#endif
17 changes: 17 additions & 0 deletions winconsole/framework.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// header.h : include file for standard system include files,
// or project specific include files
//

#pragma once

#include "targetver.h"
#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers
// Windows Header Files
#include <windows.h>
#include <shellapi.h>

// C RunTime Header Files
#include <stdlib.h>
#include <malloc.h>
#include <memory.h>
#include <tchar.h>
Binary file added winconsole/nuBasic.ico
Binary file not shown.
Binary file added winconsole/small.ico
Binary file not shown.
6 changes: 6 additions & 0 deletions winconsole/targetver.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#pragma once

// // Including SDKDDKVer.h defines the highest available Windows platform.
// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
#include <SDKDDKVer.h>
Loading

0 comments on commit c5bc6fc

Please sign in to comment.