Skip to content

Releases: weigao-china/cfstream

v1.3.0

19 Jun 08:54
288e59c

Choose a tag to compare

Cross-platform and major safety update!

Recommended for all users, especially those who need macOS/Linux support.

Changelog

  • For both C and C++ versions:

    • Added cross-platform support for restoring standard streams.
    • Changed all functions to static inline, improving header safety in multi-file projects while keeping objects in each source file independent.
  • For the C++ version cfs.hpp:

    • Added support for passing nullptr to the cfs function in C++11 and later. Its usage is the same as NULL, and NULL remains fully compatible.
  • For the C version cfs.h:

    • Added a C99 or later standard check.

Notes

  • Cross-platform standard stream restoration is designed for restoring the system terminal, including environments such as CLion Terminal.
  • Some IDE-managed run consoles may not provide a real terminal device, so the restoration feature may not work as expected in those environments.
  • Since standards earlier than C99 are rarely used today, including this header in a C project below C99 will now produce a compile-time error. Please switch to C99 or later, or use an older version of cfs, such as V1.2.0.

跨平台与重大安全更新!

推荐所有用户(特别是需要 macOS/Linux 支持的用户)更新

更新日志

  • C 与 C++ 版本。

    • 添加跨平台标准流恢复支持。
    • 所有函数统一改为 static inline,提升多源文件项目中的头文件安全性,同时保持每个源文件中的对象相互独立。
  • 对于 C++ 版本 cfs.hpp

    • 对于 C++11 及以上标准,添加了 cfs 函数参数中对 nullptr 的支持,用法与 NULL 相同且兼容 NULL
  • 对于 C 版本 cfs.h

    • 添加 C99 及以上标准检查。

注意事项

  • 跨平台标准流恢复功能适用于恢复系统终端,也包括 Clion Terminal 等。但某些 IDE 托管的运行控制台可能不提供真实终端设备,因此目前可能无法实现相应效果。
  • 考虑到 C99 以下标准使用人数少,现在 C99 以下版本包含本头文件将会报错,请切换到 C99 及以上版本或使用旧版 cfsV1.2.0

v1.2.0

17 May 12:33
356eba4

Choose a tag to compare

Major update! Recommended for all users.|重大更新!建议所有用户更新


Changelog

  1. We now support C language! The original C++ version's extension has been changed to .hpp, while the C language version uses .h.
  2. (C++ and C) The cfs function now allows passing NULL as an argument to skip redirecting a particular stream. See the README for details.
  3. Improved security-related issues, including language and version detection, etc.

更新日志

  1. 我们现在支持C语言了!原C++版本的扩展名改为 .hpp ,而C语言版本扩展名为 .h
  2. (C++与C语言)cfs函数中允许传入 NULL 参数用于不重定向某个流,具体见 README
  3. 改进了安全相关问题,包含语言与版本检测等

v1.1.0

01 May 13:08
9a069bd

Choose a tag to compare

Change Log

Added a function to get the version number and made security-related improvements.

更新日志

更新了获取版本号的函数与安全相关改进

v1.0.0

27 Apr 14:22
b98a3ef

Choose a tag to compare

‌Change Log‌

First version, currently only supported for Windows.

更新日志

初始版本,当前仅支持Windows