Skip to content

Commit abbd7b2

Browse files
committed
Replaced usage of apr_snprintf with snprintf (already in Windows exclusive code block)
- updated included headers to support compilation on Windows (using Visual C++)
1 parent 942c8ba commit abbd7b2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/unique_id.cc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "src/config.h"
1818

1919
#ifdef WIN32
20+
#include "src/compat/msvc.h"
2021
#include <winsock2.h>
2122
#include <iphlpapi.h>
2223
#endif
@@ -48,7 +49,11 @@
4849
#endif
4950

5051
#include <stdio.h>
52+
#ifndef WIN32
5153
#include <unistd.h>
54+
#else
55+
#include <io.h>
56+
#endif
5257
#include <string.h>
5358

5459
#include "src/utils/sha1.h"
@@ -207,7 +212,7 @@ std::string UniqueId::ethernetMacAddress() {
207212
pAdapter = pAdapterInfo;
208213
while (pAdapter && !mac[0] && !mac[1] && !mac[2]) {
209214
if (pAdapter->AddressLength > 4) {
210-
apr_snprintf(mac, MAC_ADDRESS_SIZE, "%02x:%02x:%02x:%02x:%02x:%02x",
215+
snprintf(mac, MAC_ADDRESS_SIZE, "%02x:%02x:%02x:%02x:%02x:%02x",
211216
(unsigned char)pAdapter->Address[0],
212217
(unsigned char)pAdapter->Address[1],
213218
(unsigned char)pAdapter->Address[2],

0 commit comments

Comments
 (0)