Skip to content

Commit

Permalink
Merge branch 'work'
Browse files Browse the repository at this point in the history
  • Loading branch information
oktonion committed Feb 2, 2023
2 parents f3d85a5 + 49c47f1 commit 06925a1
Show file tree
Hide file tree
Showing 10 changed files with 198 additions and 172 deletions.
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,34 @@ All notable changes to stdex library project will be documented in this file.

visit [https://github.com/oktonion/stdex](https://github.com/oktonion/stdex) for the latest version of stdex library

## [0.2.12] - 2023-02-02

### Added

- CodeQL build for code quality checks

### Removed

- LGTM code quality checks

### Changed

- QNX build script
- correct integral constant identification
- silently failing for `stdex::..._clock::now` if OS failed to provide correct time

### Fixed

- added missing includes
- `stdex::nullptr_t` implementation
- `stdex::this_thread::sleep_for` implementation handling for OS time shifts

### Working on

- **futures** implementation
- **move semantics** emulation
- **function** implementation

## [0.2.11] - 2022-04-22

### Added
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Branch | Appveyor| Github | Codecov
tests (development) | [![Build Status](https://ci.appveyor.com/api/projects/status/hu8800gu31xldj25?svg=true)](https://ci.appveyor.com/project/oktonion/stdex) | [![C/C++ CI](https://github.com/oktonion/stdex/actions/workflows/c-cpp.yml/badge.svg?branch=tests)](https://github.com/oktonion/stdex/actions/workflows/c-cpp.yml)| [![codecov](https://codecov.io/gh/oktonion/stdex/branch/tests/graph/badge.svg)](https://codecov.io/gh/oktonion/stdex/branch/tests)
master | [![Build Status](https://ci.appveyor.com/api/projects/status/3c53qm34v1j37hy5/branch/master?svg=true)](https://ci.appveyor.com/project/oktonion/stdex-a309e/branch/master) | [![C/C++ CI](https://github.com/oktonion/stdex/actions/workflows/c-cpp.yml/badge.svg)](https://github.com/oktonion/stdex/actions/workflows/c-cpp.yml) | [![codecov](https://codecov.io/gh/oktonion/stdex/branch/tests/graph/badge.svg)](https://codecov.io/gh/oktonion/stdex)

[![Language grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/oktonion/stdex.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/oktonion/stdex/context:cpp) | [![Codacy Badge](https://api.codacy.com/project/badge/Grade/b74b5f48d04641de81c8c76e3fc26f90)](https://www.codacy.com/app/oktonion/stdex?utm_source=github.com&utm_medium=referral&utm_content=oktonion/stdex&utm_campaign=Badge_Grade)
[![CodeQL](https://github.com/oktonion/stdex/actions/workflows/codeql.yml/badge.svg)](https://github.com/oktonion/stdex/actions/workflows/codeql.yml) | [![Codacy Badge](https://api.codacy.com/project/badge/Grade/b74b5f48d04641de81c8c76e3fc26f90)](https://www.codacy.com/app/oktonion/stdex?utm_source=github.com&utm_medium=referral&utm_content=oktonion/stdex&utm_campaign=Badge_Grade)

# stdex

Expand Down
26 changes: 0 additions & 26 deletions lgtm.yml

This file was deleted.

15 changes: 10 additions & 5 deletions stdex/build_lib_qnx.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/bin/sh

COMPILER=g++
if test -n "${COMPILER-}"; then
libname="libstdex-$COMPILER.a"
else
COMPILER=g++
libname="libstdex.a"
fi

$COMPILER --version

Expand All @@ -22,18 +27,18 @@ for file in ./src/*.cpp; do
done

if [ $build_ok -eq 0 ]; then
echo "libstdex.a build failed"
echo "$libname build failed"
exit 1
fi

mkdir ./lib

ar_args="rcs ./lib/libstdex.a"
ar_args="rcs ./lib/$libname"

for file in ./obj/*.o; do
filename=$(basename -- "$file")
filename="${filename%.*}"
echo "archiving $filename to libstdex.a"
echo "archiving $filename to $libname"
ar_args="$ar_args $file"
done

Expand All @@ -45,6 +50,6 @@ ls ./lib

echo "lib done"
echo "contains:"
ar -t "./lib/libstdex.a"
ar -t "./lib/$libname"


29 changes: 21 additions & 8 deletions stdex/include/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,10 @@
#endif
#endif

#include <cstddef>

#ifdef _STDEX_NATIVE_CPP11_SUPPORT

#include <cstddef>
namespace stdex
{
namespace detail
Expand All @@ -201,20 +202,32 @@
typedef std::nullptr_t nullptr_t;
}
#else
#include "nullptr.h"
#if defined(_STDEX_IMPLEMENTS_NULLPTR_SUPPORT)
#include "nullptr.h"
#else
namespace stdex
{
typedef std::nullptr_t nullptr_t;
}
#endif // _STDEX_IMPLEMENTS_NULLPTR_SUPPORT
#endif

#else //no C++11 support

// nullptr and nullptr_t implementation
#if defined(_STDEX_IMPLEMENTS_NULLPTR_SUPPORT) && !defined(_STDEX_NATIVE_NULLPTR_SUPPORT)
#if defined(_STDEX_IMPLEMENTS_NULLPTR_SUPPORT)
#include "nullptr.h"
#elif defined(_STDEX_NATIVE_NULLPTR_SUPPORT)
namespace stdex
{
typedef std::nullptr_t nullptr_t;
}
#else
namespace stdex
{
typedef std::nullptr_t nullptr_t;
}
#endif // _STDEX_IMPLEMENTS_NULLPTR_SUPPORT && !_STDEX_NATIVE_NULLPTR_SUPPORT
namespace stdex
{
typedef nullptr_t nullptr_t;
}
#endif // _STDEX_IMPLEMENTS_NULLPTR_SUPPORT

namespace stdex
{
Expand Down
6 changes: 5 additions & 1 deletion stdex/include/cstdint.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,11 @@ namespace stdex

template<class _Tp>
struct _is_integral_constant:
_is_integral_constant_impl<_Tp, _is_integral_constant_std_impl<long>::value>
_is_integral_constant_impl<_Tp,
_is_integral_constant_std_impl<unsigned short>::value == bool(true)
&& _is_integral_constant_std_impl<long>::value == bool(true)
&& _is_integral_constant_std_impl<signed char>::value == bool(true)
>
{

};
Expand Down
2 changes: 1 addition & 1 deletion stdex/include/system_error.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1240,7 +1240,7 @@ namespace stdex

class _strerrorlen_s_arg
{
typedef size_t return_type;
typedef std::size_t return_type;
char buf[sizeof(return_type) * 12];
_strerrorlen_s_arg(...);
operator return_type();
Expand Down
16 changes: 12 additions & 4 deletions stdex/src/chrono.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,9 @@ namespace WinAPI
return true;
}
}
} else
{
hKernel32 = GetModuleHandleW(L"kernel32.dll");
}
return false;
}
Expand All @@ -246,6 +249,9 @@ namespace WinAPI
return true;
}
}
} else
{
hKernel32 = GetModuleHandleW(L"kernel32.dll");
}
return false;
}
Expand Down Expand Up @@ -1461,9 +1467,10 @@ stdex::chrono::system_clock::time_point stdex::chrono::system_clock::now() _STDE
ts.tv_sec = 0;
ts.tv_nsec = 0;

if ((*clock_gettime_func_pointer)(_STDEX_CHRONO_CLOCK_REALTIME, &ts) != 0)
for (std::size_t i = 0; i < 10; ++i)
{
std::terminate();
if ((*clock_gettime_func_pointer)(_STDEX_CHRONO_CLOCK_REALTIME, &ts) == 0)
break;
}

duration tv_nsec = 0;
Expand All @@ -1483,9 +1490,10 @@ stdex::chrono::steady_clock::time_point stdex::chrono::steady_clock::now() _STDE
ts.tv_sec = 0;
ts.tv_nsec = 0;

if ((*clock_gettime_func_pointer)(_STDEX_CHRONO_CLOCK_MONOTONIC, &ts) != 0)
for (std::size_t i = 0; i < 10; ++i)
{
std::terminate();
if ((*clock_gettime_func_pointer)(_STDEX_CHRONO_CLOCK_MONOTONIC, &ts) == 0)
break;
}

duration tv_nsec = 0;
Expand Down
Loading

0 comments on commit 06925a1

Please sign in to comment.