[libc-commits] [PATCH] D121839: [libc] Clean up Windows build

Michael Jones via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Mar 16 12:10:20 PDT 2022


michaelrj created this revision.
michaelrj added reviewers: sivachandra, lntue.
Herald added subscribers: libc-commits, ecnelises, tschuett.
Herald added projects: libc-project, All.
michaelrj requested review of this revision.

This patch catches the Windows build up with the recent formatting and
entrypoint name changes. This should allow the Windows build to succeed.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D121839

Files:
  libc/config/windows/entrypoints.txt
  libc/src/__support/FPUtil/x86_64/FEnvImpl.h


Index: libc/src/__support/FPUtil/x86_64/FEnvImpl.h
===================================================================
--- libc/src/__support/FPUtil/x86_64/FEnvImpl.h
+++ libc/src/__support/FPUtil/x86_64/FEnvImpl.h
@@ -345,8 +345,8 @@
 // MSVC fenv.h defines a very simple representation of the floating point state
 // which just consists of control and status words of the x87 unit.
 struct FPState {
-  uint32_t ControlWord;
-  uint32_t StatusWord;
+  uint32_t control_word;
+  uint32_t status_word;
 };
 #else
 struct FPState {
@@ -364,20 +364,20 @@
 #ifdef _WIN32
 static inline int get_env(fenv_t *envp) {
   internal::FPState *state = reinterpret_cast<internal::FPState *>(envp);
-  internal::X87StateDescriptor X87Status;
-  internal::getX87StateDescriptor(X87Status);
-  state->ControlWord = X87Status.ControlWord;
-  state->StatusWord = X87Status.StatusWord;
+  internal::X87StateDescriptor x87_status;
+  internal::get_x87_state_descriptor(x87_status);
+  state->control_word = x87_status.control_word;
+  state->status_word = x87_status.status_word;
   return 0;
 }
 
 static inline int set_env(const fenv_t *envp) {
   const internal::FPState *state =
       reinterpret_cast<const internal::FPState *>(envp);
-  internal::X87StateDescriptor X87Status;
-  X87Status.ControlWord = state->ControlWord;
-  X87Status.StatusWord = state->StatusWord;
-  internal::writeX87StateDescriptor(X87Status);
+  internal::X87StateDescriptor x87_status;
+  x87_status.control_word = state->control_word;
+  x87_status.status_word = state->status_word;
+  internal::write_x87_state_descriptor(x87_status);
   return 0;
 }
 #else
Index: libc/config/windows/entrypoints.txt
===================================================================
--- libc/config/windows/entrypoints.txt
+++ libc/config/windows/entrypoints.txt
@@ -17,9 +17,6 @@
     libc.src.ctype.tolower
     libc.src.ctype.toupper
 
-    # errno.h entrypoints
-    libc.src.errno.__errno_location
-
     # string.h entrypoints
     libc.src.string.bcmp
     libc.src.string.bzero


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D121839.415935.patch
Type: text/x-patch
Size: 2039 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20220316/79c332ab/attachment-0001.bin>


More information about the libc-commits mailing list