Browse Source

Merge pull request #2473 from svaarala/djgpp-port-fix

Add DJGPP platform support
pull/2474/head
Sami Vaarala 3 years ago
committed by GitHub
parent
commit
e1e398e2c4
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      config/compilers/compiler_gcc.h.in
  2. 12
      config/helper-snippets/DUK_F_DJGPP.h.in
  3. 3
      config/helper-snippets/DUK_F_MSDOS.h.in
  4. 4
      config/platforms.yaml
  5. 19
      config/platforms/platform_msdos.h.in
  6. 1
      releases/releases.yaml

2
config/compilers/compiler_gcc.h.in

@ -55,6 +55,8 @@
#else
#define DUK_USE_COMPILER_STRING "mingw"
#endif
#elif defined(DUK_F_DJGPP)
#define DUK_USE_COMPILER_STRING "djgpp"
#else
#if defined(DUK_F_CPP)
#define DUK_USE_COMPILER_STRING "g++"

12
config/helper-snippets/DUK_F_DJGPP.h.in

@ -0,0 +1,12 @@
/* DJGPP (MSDOS), see https://sourceforge.net/p/predef/wiki/Compilers/ */
#if defined(__DJGPP__)
#define DUK_F_DJGPP
#define DUK_F_DJGPP_MAJOR __DJGPP__
#if defined(__DJGPP_MINOR__)
#define DUK_F_DJGPP_MINOR __DJGPP_MINOR__
#else
#define DUK_F_DJGPP_MINOR 0
#endif
#define DUK_F_DJGPP_PATCH 0
#define DUK_F_DJGPP_VERSION (DUK_F_DJGPP_MAJOR * 10000L + DUK_F_DJGPP_MINOR * 100L + DUK_F_DJGPP_PATCH)
#endif

3
config/helper-snippets/DUK_F_MSDOS.h.in

@ -0,0 +1,3 @@
#if defined(__MSDOS__) || defined(__MSDOS) || defined(MSDOS)
#define DUK_F_MSDOS
#endif

4
config/platforms.yaml

@ -11,6 +11,10 @@ autodetect:
name: Orbis
check: DUK_F_ORBIS
include: platform_orbis.h.in
-
name: MS-DOS
check: DUK_F_MSDOS
include: platform_msdos.h.in
-
name: OpenBSD
check: DUK_F_OPENBSD

19
config/platforms/platform_msdos.h.in

@ -0,0 +1,19 @@
#if defined(DUK_F_DJGPP)
/* These are for DJGPP, add #ifdefs for other MS-DOS compilers as needed. */
#define DUK_USE_DATE_NOW_GETTIMEOFDAY
#define DUK_USE_DATE_TZO_GMTIME_R
#undef DUK_USE_DATE_PRS_STRPTIME /* Not supported, see: https://github.com/svaarala/duktape/issues/2472 */
#define DUK_USE_DATE_FMT_STRFTIME
#include <time.h>
#include <sys/time.h>
#else
/* Placeholder, unlikely to work outside of DJGPP. */
#define DUK_USE_DATE_NOW_GETTIMEOFDAY
#define DUK_USE_DATE_TZO_GMTIME_R
#undef DUK_USE_DATE_PRS_STRPTIME
#define DUK_USE_DATE_FMT_STRFTIME
#include <time.h>
#include <sys/time.h>
#endif
#define DUK_USE_OS_STRING "msdos"

1
releases/releases.yaml

@ -1394,3 +1394,4 @@ duktape_releases:
- "Use wasm for dukweb.js compilation (including duktape.org site), fix async loading of emcc-compiled code in dukweb.html (GH-2244)"
- "Improve DUK_USE_OS_STRING for macOS, iOS, watchOS, and tvOS (GH-2288)"
- "Fix JSON.stringify() handling of Array 'replacer' duplicates (e.g. JSON.stringify({foo: 123}, [\"foo\", \"foo\"])); previously incorrectly serialized multiple times, now only once (GH-2379)"
- "Add support for DJGPP (MSDOS) platform (GH-2472, GH-2473)"

Loading…
Cancel
Save