Code Monkey home page Code Monkey logo

not-enough-standards's People

Contributors

alairion avatar alexypellegrini avatar studoot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

not-enough-standards's Issues

An error in pipe.hpp

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.

Build Error on macOS

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

Mixing UTF-8 and ANSI on Windows

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.

Add 'detached process' option

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.

Problem when using not-enough-standards with CMake's `add_subdirectory`

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.