native-machine-id 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/binding.cc +5 -5
- package/package.json +1 -1
package/binding.cc
CHANGED
|
@@ -5,11 +5,11 @@
|
|
|
5
5
|
#include <CoreFoundation/CoreFoundation.h>
|
|
6
6
|
#include <IOKit/IOKitLib.h>
|
|
7
7
|
#include <AvailabilityMacros.h>
|
|
8
|
-
//
|
|
9
|
-
#if
|
|
10
|
-
#define
|
|
8
|
+
// Ensure compatibility with older macOS
|
|
9
|
+
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 120000
|
|
10
|
+
#define IO_PORT kIOMainPortDefault
|
|
11
11
|
#else
|
|
12
|
-
#define
|
|
12
|
+
#define IO_PORT 0
|
|
13
13
|
#endif
|
|
14
14
|
#elif defined(__linux__)
|
|
15
15
|
#include <fstream>
|
|
@@ -28,7 +28,7 @@ namespace
|
|
|
28
28
|
std::string getMachineId() noexcept
|
|
29
29
|
{
|
|
30
30
|
std::string uuid;
|
|
31
|
-
io_registry_entry_t ioRegistryRoot = IORegistryEntryFromPath(
|
|
31
|
+
io_registry_entry_t ioRegistryRoot = IORegistryEntryFromPath(IO_PORT, "IOService:/");
|
|
32
32
|
|
|
33
33
|
if (ioRegistryRoot == MACH_PORT_NULL)
|
|
34
34
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "native-machine-id",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "Native retrieval of a unique desktop machine ID without admin privileges or child processes. Faster and more reliable alternative to node-machine-id.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|