alairion / not-enough-standards Goto Github PK
View Code? Open in Web Editor NEWA modern header-only C++ library that provides platform-independent utilities.
License: MIT License
A modern header-only C++ library that provides platform-independent utilities.
License: MIT License
I got an error message when trying to check out the library.
nes/pipe.hpp:575:35: error: 'other' was not declared in this scope
I can confirm that it is an issue after taking a look at the code.
Was this tested on macOS ? Because there is a build error on macOS when attempting to consume process.hpp
not-enough-standards-src/include/nes/process.hpp:44:14: fatal error: wait.h: No such file or directory
44 | #include <wait.h>
I thought on macOS (and FreeBSD) this header should be <sys/wait.h>
. I checked my Xcode header directory and also confirmed this is at sys/wait.h
cd /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
MacOSX.sdk ➤ fd wait.h
usr/include/sys/wait.h
Hi, just letting you know, that you are mixing ANSI API, which uses current system code page, and UTF-8 (converting to/from wide strings with MultiByteToWideChar/UTF-8), which is not really a good idea.
When using MultiByteToWideChar, I suggest you also set a flag to fail on invalid UTF-8 instead of having it silently replaced by '?' character and then using wrong paths/names.
Hard casting string sizes from size_t to int is also unsafe. You should at least have an assetion there that it doesn't overflow INT_MAX. I know, who sane would pass a string that large ... but its possible attack vector on applications consuming your library.
I've recently had need of a detached process on Windows (i.e. it doesn't open a new console window) while using not-enough-standards
.
I implemented this by adding a detached
flag to process_options
and processing it in the Windows implementation of the relevant process
constructor (here's the commit in my fork).
This is a feature that I think Winows programmers would find useful and I'm quite happy to create a PR for this. I'm not sure that Linux has an equivalent need (I'm not particularly experienced with Linux, though), in which case detached
would be a no-op. If you had other suggestions, please let me know.
I'm using not-enough-standards within my project (which uses CMake) by using a statement like this in my CMakeLists.txt:
add_subdirectory(../externals/not-enough-standards ${CMAKE_CURRENT_BINARY_DIR}/nes EXCLUDE_FROM_ALL)
But I get errors in the configure stage at the first add_library
that uses it:
CMake Error at CMakeLists.txt:56 (add_library):
Cannot find source file:
"<redacted>/externals/not-enough-standards/include/nes/shared_library.hpp"
Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm .h
.hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .hip .ispc
It seems that this comes from quoting paths in the generator expressions in the NotEnoughStandards target_sources
statement (lines 15-25 of the not-enough-standards CMakeLists.txt):
target_sources(NotEnoughStandards INTERFACE
$<BUILD_INTERFACE:"${PROJECT_SOURCE_DIR}/include/nes/shared_library.hpp">
$<BUILD_INTERFACE:"${PROJECT_SOURCE_DIR}/include/nes/shared_memory.hpp">
$<BUILD_INTERFACE:"${PROJECT_SOURCE_DIR}/include/nes/named_mutex.hpp">
$<BUILD_INTERFACE:"${PROJECT_SOURCE_DIR}/include/nes/semaphore.hpp">
$<BUILD_INTERFACE:"${PROJECT_SOURCE_DIR}/include/nes/named_semaphore.hpp">
$<BUILD_INTERFACE:"${PROJECT_SOURCE_DIR}/include/nes/pipe.hpp">
$<BUILD_INTERFACE:"${PROJECT_SOURCE_DIR}/include/nes/process.hpp">
$<BUILD_INTERFACE:"${PROJECT_SOURCE_DIR}/include/nes/hash.hpp">
$<BUILD_INTERFACE:"${PROJECT_SOURCE_DIR}/include/nes/thread_pool.hpp">
)
I think the reason is that CMake doesn't strip quotes from the results of generator expressions, so the rest of CMake receives a path that contains the quotes, which is an invalid path (certainly on Windows, where I'm using it...).
I'll create a PR to fix this.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.