Commit graph

25 commits

Author SHA1 Message Date
Stephen Dennis
ebe0b9f0a7 Build: Regenerate tables after Win32 linkage fixes; drop OTT cpp guard
Regenerate all pipeline outputs to pick up the Windows agent's
LIBMUX_API and extern "C" changes from smutil.cpp, strings.cpp,
and pairs.cpp.

Remove the #ifndef __cplusplus guard around OTT extern declarations
in C-mode strings output. Our architecture has the OTT defined as
co_string_desc in unicode_tables.c (C linkage) — both C and C++
consumers need the extern visible. CO_OTT_CAST handles the pointer
type difference.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 17:49:24 -06:00
Stephen Dennis
2b41020100 Win32: Fix Windows build — DLL exports, C/C++ linkage, MSVC compat
- color_ops.h: Add LIBMUX_API to all co_* declarations; fix CO_CS_NORMAL
  compound literal for MSVC (both C and C++ modes)
- color_ops.c: Remove redundant (co_ColorState) casts that fail on MSVC C
- utf8tables.h/cpp: Add extern "C" wrapping for C/C++ linkage compatibility
- stringutil.h/cpp: extern "C" on utf8_FirstByte; LIBMUX_API on co_console_width
- unicode_tables_c.h: Guard extern declarations with #ifndef __cplusplus
  (C++ gets them from utf8tables.h with proper LIBMUX_API and types);
  add CO_OTT_CAST macro for string_desc/co_string_desc pointer conversion;
  add proper LIBMUX_API fallback with dllexport/dllimport for Windows
- libmux.vcxproj: Add color_ops.c and unicode_tables.c as C compilation units
- ast.cpp: Use QueryPerformanceCounter for WIN32 astbench timing
- engine_com.cpp, functions.h, functions.cpp: Guard JIT-only code with TINYMUX_JIT
- utf/ generators: Add LIBMUX_API to all extern declarations in smutil.cpp,
  strings.cpp, pairs.cpp; strings.cpp guards OTT externs with #ifndef __cplusplus;
  preamble/postamble updated with CO_OTT_CAST and proper LIBMUX_API fallback

NOTE: Build not yet clean — ubuntu agent needs to regenerate auto-generated
files (utf8tables.h, utf8tables.cpp, unicode_tables_c.h) from updated
utf/ generators to pick up all LIBMUX_API and linkage fixes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 17:42:02 -06:00
Stephen Dennis
025f6a42b8 Build: Generate all unicode table files from utf/ pipeline directly
Add -o/-i flags to classify, integers, strings, and pairs tools so
they write to caller-specified paths instead of hardcoded .txt files.
Add -c flag to strings for C-mode output (co_string_desc, C casts).

Rewrite utf/Makefile.in to generate all output files directly in
their final locations:
  mux/include/utf8tables.h       — C++ header (libmux.so)
  mux/lib/utf8tables.cpp         — C++ table data (libmux.so)
  mux/include/unicode_tables_c.h — C header (color_ops, rv64)
  ragel/unicode_tables.h         — symlink to unicode_tables_c.h
  ragel/unicode_tables.c         — C tables (case mapping)
  mux/rv64/src/unicode_tables.c  — C tables (case + widths + gcb)

The C header is assembled from preamble + generated DFA declarations +
postamble (inline DFA runner functions). No manual sync needed — the
upper_sbt debacle cannot recur.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 16:41:36 -06:00
Stephen Dennis
dbd7cb4267 Use nullptr instead of NULL. 2025-03-30 09:10:10 -06:00
Stephen Dennis
b6af272a75 More cautious on Xoring strings while maintaining output consistency
- Introduce HandleXorArraySafely to perform safe XOR operations on UTF-8
  strings with validations for input length and buffer size.
- Replace inline XOR loops in BuildOutputTable and TestTable with the new
  helper function.
- The changes produce the same output while enhancing code safety.
2025-03-25 07:17:38 -06:00
Stephen Dennis
83eabcc58e Fix compiler warnings. 2022-02-27 23:47:09 -07:00
Stephen Dennis
8b1c5cdd9e Remove SVN version stamp. 2020-08-08 17:39:08 -06:00
brazilofmux
b1d4ef1d51 Remove trailing spaces. 2012-05-18 13:45:31 -07:00
brazilofmux
25ea4afafc Use run-length encoded Unicode tables. 2009-02-01 13:40:38 -08:00
brazilofmux
11f4912245 Remove ReportStatus(). 2009-01-31 16:41:12 -08:00
Brazil
1165f7d096 Fix build of ./utf directory on newer compilers. 2008-04-15 07:42:01 -07:00
brazilofmux
f52657b803 Generate separate copy/paste for stringutil.cpp and stringutil.h to make it less manual. 2008-04-12 22:20:42 -07:00
brazilofmux
8ede1865a0 Fix compiler warnings. 2007-12-21 15:00:45 -08:00
brazilofmux
669743bedf -- Forgot to duplicate snippet that handled multiple code points.
git-svn-id: https://tinymux.googlecode.com/svn/branches/dev_brazil@1738 d1b986fa-651c-0410-a323-35a8662cf44d
2007-05-09 22:22:37 -07:00
brazilofmux
e1caa8ef80 -- Change capstr() to rely on title-casing instead of upper-casing.
git-svn-id: https://tinymux.googlecode.com/svn/branches/dev_brazil@1689 d1b986fa-651c-0410-a323-35a8662cf44d
2007-05-09 15:36:10 -07:00
brazilofmux
4ea3d3ed30 -- Expand toupper and tolower to support 930+ code points.
git-svn-id: https://tinymux.googlecode.com/svn/branches/dev_brazil@1663 d1b986fa-651c-0410-a323-35a8662cf44d
2007-05-09 15:20:21 -07:00
brazilofmux
769a869ebc -- Add space before comment.
git-svn-id: https://tinymux.googlecode.com/svn/branches/dev_brazil@1662 d1b986fa-651c-0410-a323-35a8662cf44d
2007-05-09 15:20:21 -07:00
brazilofmux
0a627cb029 -- Add literal and xor tabls to strings.cpp generation.
git-svn-id: https://tinymux.googlecode.com/svn/branches/dev_brazil@1661 d1b986fa-651c-0410-a323-35a8662cf44d
2007-05-09 15:20:21 -07:00
brazilofmux
d46e499daa -- cl_Lower.txt and cl_Upper are redudnant since Unicode defines lowercase
and uppercase in terms of whether a character maps to itself with
    tr_toupper and tr_tolower.

git-svn-id: https://tinymux.googlecode.com/svn/branches/dev_brazil@1660 d1b986fa-651c-0410-a323-35a8662cf44d
2007-05-09 15:20:21 -07:00
brazilofmux
34932af89f -- Build tr_tolower.txt and tr_toupper.txt from UnicodeMaster.
-- Support wider range of upper and lower case code points.

git-svn-id: https://tinymux.googlecode.com/svn/branches/dev_brazil@1652 d1b986fa-651c-0410-a323-35a8662cf44d
2007-05-09 15:17:54 -07:00
brazilofmux
3f81d484ff -- Correct spelling in recent comments.
git-svn-id: https://tinymux.googlecode.com/svn/branches/dev_brazil@1650 d1b986fa-651c-0410-a323-35a8662cf44d
2007-05-09 15:17:12 -07:00
brazilofmux
6e1876cd49 -- Document current and future behavior of strings.cpp.
git-svn-id: https://tinymux.googlecode.com/svn/branches/dev_brazil@1648 d1b986fa-651c-0410-a323-35a8662cf44d
2007-05-09 15:17:12 -07:00
brazilofmux
a157376421 -- Change ReadCodePoint() in strings to ReadCodePointAndOthercase().
git-svn-id: https://tinymux.googlecode.com/svn/branches/dev_brazil@1622 d1b986fa-651c-0410-a323-35a8662cf44d
2007-05-09 15:08:10 -07:00
brazilofmux
c51ff824bb -- Change ReadCodePoint for classify.cpp to look only for first field.
git-svn-id: https://tinymux.googlecode.com/svn/branches/dev_brazil@1621 d1b986fa-651c-0410-a323-35a8662cf44d
2007-05-09 15:07:56 -07:00
brazilofmux
f24d38a0ea -- Split transform.cpp into integers.cpp and strings.cpp because they are going to handle very different things.
git-svn-id: https://tinymux.googlecode.com/svn/branches/dev_brazil@1616 d1b986fa-651c-0410-a323-35a8662cf44d
2007-05-09 15:05:23 -07:00
Renamed from utf/transform.cpp (Browse further)