[flang-commits] [flang] [llvm] [clang] [clang-tools-extra] [flang] GETLOG runtime and extension implementation: get login username (PR #74628)

Kiran Chandramohan via flang-commits flang-commits at lists.llvm.org
Fri Dec 8 06:45:24 PST 2023


================
@@ -10,10 +10,50 @@
 // extensions that will eventually be implemented in Fortran.
 
 #include "flang/Runtime/extensions.h"
+#include "flang/Runtime/character.h"
 #include "flang/Runtime/command.h"
 #include "flang/Runtime/descriptor.h"
 #include "flang/Runtime/io-api.h"
 
+#ifdef _WIN32
+#define WIN32_LEAN_AND_MEAN
+#define NOMINMAX
+#include <windows.h>
+
+#include <cstdlib> // wcstombs_s
+#include <lmcons.h> // UNLEN=256
+#include <wchar.h> // wchar_t cast to LPWSTR
+#pragma comment(lib, "Advapi32.lib") // Link Advapi32.lib for GetUserName
----------------
kiranchandramohan wrote:

We usually avoid depending on external libraries. Can this be avoided?

https://github.com/llvm/llvm-project/pull/74628


More information about the flang-commits mailing list