File tree Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -88,8 +88,8 @@ let operatingSystemVersion: String = {
8888    } 
8989  } 
9090#elseif os(WASI) 
91-   if let  libcVersion  =  swt_getWASIVersion ( ) . flatMap ( String . init ( validatingCString: ) ) ,  !libcVersion . isEmpty  { 
92-     return  " WASI with libc  \( libcVersion ) " 
91+   if let  version  =  swt_getWASIVersion ( ) . flatMap ( String . init ( validatingCString: ) )  { 
92+     return  version 
9393  } 
9494#else 
9595#warning("Platform-specific implementation missing: OS version unavailable") 
Original file line number Diff line number Diff line change 1010
1111#include  " Versions.h" 
1212
13- #if  defined(_SWT_TESTING_LIBRARY_VERSION)
13+ #if  defined(__wasi__) && __has_include(<wasi/version.h>)
14+ #include  < wasi/version.h> 
15+ #endif 
16+ 
17+ #if  defined(_SWT_TESTING_LIBRARY_VERSION) && !defined(SWT_TESTING_LIBRARY_VERSION)
1418#warning  _SWT_TESTING_LIBRARY_VERSION is deprecated
1519#warning  Define SWT_TESTING_LIBRARY_VERSION and optionally SWT_TARGET_TRIPLE instead
20+ #define  SWT_TESTING_LIBRARY_VERSION  _SWT_TESTING_LIBRARY_VERSION
1621#endif 
1722
1823const  char  *swt_getTestingLibraryVersion (void ) {
@@ -41,8 +46,8 @@ const char *swt_getTargetTriple(void) {
4146
4247#if  defined(__wasi__)
4348const  char  *swt_getWASIVersion (void ) {
44- #if  defined(WASI_LIBC_VERSION )
45-   return  WASI_LIBC_VERSION ;
49+ #if  defined(WASI_SDK_VERSION )
50+   return  WASI_SDK_VERSION ;
4651#else 
4752  return  nullptr ;
4853#endif 
Original file line number Diff line number Diff line change @@ -32,10 +32,10 @@ SWT_EXTERN const char *_Nullable swt_getTargetTriple(void);
3232/// Get the version of the C standard library and runtime used by WASI, if 
3333/// available. 
3434/// 
35- /// This function is provided because `WASI_LIBC_VERSION ` may or may not be 
35+ /// This function is provided because `WASI_SDK_VERSION ` may or may not be 
3636/// defined and may or may not be a complex macro. 
3737/// 
38- /// For more information about the `WASI_LIBC_VERSION ` macro, see 
38+ /// For more information about the `WASI_SDK_VERSION ` macro, see 
3939/// [wasi-libc-#490](https://github.com/WebAssembly/wasi-libc/issues/490). 
4040SWT_EXTERN  const  char  * _Nullable  swt_getWASIVersion (void );
4141
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments