drogonframework / drogonframework/drogon

htonll() and Windows 7

Open
#922 7 comments 0 reactions 0 assignees View on GitHub
enhancement
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.