drogonframework / drogonframework/drogon
htonll() and Windows 7
- Dominant language
- C++
- Stars
- 14.3k
- Forks
- 1.4k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 14
Description
**Is your feature request related to a problem? Please describe.**
`htonll()` (used in orm_lib/inc/drogon/orm/SqlBinder.h) is only available since Windows 8 and when compiling with `NTDDI_VERSION>=NTDDI_WIN8`. However I'd like to be able to compile and run our applications still on Windows 7.
**Describe the solution you'd like**
ATVL add a preprocessor condition to the existing ones that determine whether a fallback for htonll() and ntohll() need to be defined ad hoc:
```
#if defined __linux__ || defined __FreeBSD__ || defined __OpenBSD__ || \
defined __MINGW32__ || (defined NTDDI_VERSION && NTDDI_VERSION < NTDDI_WIN8)
```
Ideally I'd even like to see a custom macro denoting the minimum Windows SDK version to use, which can be set at configuration time, e.g. `DR_NTDDI_VERSION` which defaults to `NTDDI_VERSION`. This would separate the concerns of the library and the application (which possibly pulls in a higher Windows SDK version, but is using runtime function bindings).
**Additional context**
- OS: Windows 7
Contributor guide
Assessment
This issue has not been assessed yet.