winlog 0.1.0

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.
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+ #
3
+ # extconf.rb for the winlog extension — registration-free ETW TraceLogging emit
4
+ # via Microsoft's TraceLoggingDynamic.h (vendored, MIT) and advapi32.
5
+
6
+ require "mkmf"
7
+
8
+ unless RbConfig::CONFIG["target_os"] =~ /mswin/
9
+ abort <<~MSG
10
+ winlog requires a native Windows MSVC (mswin) Ruby — it emits ETW
11
+ TraceLogging events (EventRegister / EventWriteTransfer, advapi32.dll)
12
+ through Microsoft's C++ TraceLoggingDynamic.h and is built with cl.exe.
13
+ Your Ruby is "#{RbConfig::CONFIG['arch']}".
14
+ MSG
15
+ end
16
+
17
+ # C++ (TraceLoggingDynamic.h: templates + std::vector); enable exceptions.
18
+ # -std:c++17 and -DNOMINMAX are the spike-verified configuration (research
19
+ # spike compiled clean with mkmf defaults + these). No /MACHINE or -arch flags:
20
+ # the guard above is /mswin/-only (arch-neutral) so an arm64-mswin Ruby would
21
+ # build this unchanged (arm64.md §8).
22
+ $CXXFLAGS << " -EHsc -std:c++17"
23
+ $defs << "-DNOMINMAX"
24
+
25
+ # System import libs (bare "NAME.lib" tokens on mswin):
26
+ # advapi32 - ETW provider APIs (EventRegister / EventWriteTransfer /
27
+ # EventUnregister / EventSetInformation / EventActivityIdControl)
28
+ $libs = [$libs, "advapi32.lib"].join(" ")
29
+
30
+ create_makefile("winlog/winlog")