@@ -663,7 +663,6 @@ pub mod types {
663
663
}
664
664
}
665
665
666
- #[ cfg( target_arch = "x86" ) ]
667
666
pub mod arch {
668
667
pub mod c95 {
669
668
pub type c_char = i8 ;
@@ -677,27 +676,53 @@ pub mod types {
677
676
pub type c_ulong = u32 ;
678
677
pub type c_float = f32 ;
679
678
pub type c_double = f64 ;
679
+
680
+ #[ cfg( target_arch = "x86" ) ]
680
681
pub type size_t = u32 ;
682
+ #[ cfg( target_arch = "x86_64" ) ]
683
+ pub type size_t = u64 ;
684
+
685
+ #[ cfg( target_arch = "x86" ) ]
681
686
pub type ptrdiff_t = i32 ;
687
+ #[ cfg( target_arch = "x86_64" ) ]
688
+ pub type ptrdiff_t = i64 ;
689
+
682
690
pub type clock_t = i32 ;
691
+
692
+ #[ cfg( target_arch = "x86" ) ]
683
693
pub type time_t = i32 ;
694
+ #[ cfg( target_arch = "x86_64" ) ]
695
+ pub type time_t = i64 ;
696
+
684
697
pub type wchar_t = u16 ;
685
698
}
699
+
686
700
pub mod c99 {
687
701
pub type c_longlong = i64 ;
688
702
pub type c_ulonglong = u64 ;
689
703
pub type intptr_t = int ;
690
704
pub type uintptr_t = uint ;
691
705
}
706
+
692
707
pub mod posix88 {
693
708
pub type off_t = i32 ;
694
709
pub type dev_t = u32 ;
695
710
pub type ino_t = i16 ;
711
+
712
+ #[ cfg( target_arch = "x86" ) ]
696
713
pub type pid_t = i32 ;
714
+ #[ cfg( target_arch = "x86_64" ) ]
715
+ pub type pid_t = i64 ;
716
+
697
717
pub type useconds_t = u32 ;
698
718
pub type mode_t = u16 ;
719
+
720
+ #[ cfg( target_arch = "x86" ) ]
699
721
pub type ssize_t = i32 ;
722
+ #[ cfg( target_arch = "x86_64" ) ]
723
+ pub type ssize_t = i64 ;
700
724
}
725
+
701
726
pub mod posix01 {
702
727
}
703
728
pub mod posix08 {
@@ -725,19 +750,23 @@ pub mod types {
725
750
726
751
pub type LONG = c_long ;
727
752
pub type PLONG = * mut c_long ;
753
+
754
+ #[ cfg( target_arch = "x86" ) ]
728
755
pub type LONG_PTR = c_long ;
756
+ #[ cfg( target_arch = "x86_64" ) ]
757
+ pub type LONG_PTR = i64 ;
729
758
730
759
pub type LARGE_INTEGER = c_longlong ;
731
760
pub type PLARGE_INTEGER = * mut c_longlong ;
732
761
733
762
pub type LPCWSTR = * WCHAR ;
734
763
pub type LPCSTR = * CHAR ;
735
- pub type LPCTSTR = * CHAR ;
736
- pub type LPTCH = * CHAR ;
737
764
738
765
pub type LPWSTR = * mut WCHAR ;
739
766
pub type LPSTR = * mut CHAR ;
740
- pub type LPTSTR = * mut CHAR ;
767
+
768
+ pub type LPWCH = * mut WCHAR ;
769
+ pub type LPCH = * mut CHAR ;
741
770
742
771
// Not really, but opaque to us.
743
772
pub type LPSECURITY_ATTRIBUTES = LPVOID ;
@@ -760,9 +789,9 @@ pub mod types {
760
789
761
790
pub struct STARTUPINFO {
762
791
cb : DWORD ,
763
- lpReserved : LPTSTR ,
764
- lpDesktop : LPTSTR ,
765
- lpTitle : LPTSTR ,
792
+ lpReserved : LPWSTR ,
793
+ lpDesktop : LPWSTR ,
794
+ lpTitle : LPWSTR ,
766
795
dwX : DWORD ,
767
796
dwY : DWORD ,
768
797
dwXSize : DWORD ,
@@ -843,172 +872,6 @@ pub mod types {
843
872
pub type LPOVERLAPPED = * mut OVERLAPPED ;
844
873
}
845
874
}
846
-
847
- #[ cfg( target_arch = "x86_64" ) ]
848
- pub mod arch {
849
- pub mod c95 {
850
- pub type c_char = i8 ;
851
- pub type c_schar = i8 ;
852
- pub type c_uchar = u8 ;
853
- pub type c_short = i16 ;
854
- pub type c_ushort = u16 ;
855
- pub type c_int = i32 ;
856
- pub type c_uint = u32 ;
857
- pub type c_long = i32 ;
858
- pub type c_ulong = u32 ;
859
- pub type c_float = f32 ;
860
- pub type c_double = f64 ;
861
- pub type size_t = u64 ;
862
- pub type ptrdiff_t = i64 ;
863
- pub type clock_t = i32 ;
864
- pub type time_t = i64 ;
865
- pub type wchar_t = u16 ;
866
- }
867
- pub mod c99 {
868
- pub type c_longlong = i64 ;
869
- pub type c_ulonglong = u64 ;
870
- pub type intptr_t = int ;
871
- pub type uintptr_t = uint ;
872
- }
873
- pub mod posix88 {
874
- pub type off_t = i32 ; // XXX unless _FILE_OFFSET_BITS == 64
875
- pub type dev_t = u32 ;
876
- pub type ino_t = i16 ;
877
- pub type pid_t = i64 ;
878
- pub type useconds_t = u32 ;
879
- pub type mode_t = u16 ;
880
- pub type ssize_t = i64 ;
881
- }
882
- pub mod posix01 {
883
- }
884
- pub mod posix08 {
885
- }
886
- pub mod bsd44 {
887
- }
888
- pub mod extra {
889
- use ptr;
890
- use libc:: types:: common:: c95:: c_void;
891
- use libc:: types:: os:: arch:: c95:: { c_char, c_int, c_uint, size_t} ;
892
- use libc:: types:: os:: arch:: c95:: { c_ulong} ;
893
- use libc:: types:: os:: arch:: c95:: { wchar_t} ;
894
- use libc:: types:: os:: arch:: c99:: { c_ulonglong} ;
895
-
896
- pub type BOOL = c_int ;
897
- pub type BYTE = u8 ;
898
- pub type CCHAR = c_char ;
899
- pub type CHAR = c_char ;
900
-
901
- pub type DWORD = c_ulong ;
902
- pub type DWORDLONG = c_ulonglong ;
903
-
904
- pub type HANDLE = LPVOID ;
905
- pub type HMODULE = c_uint ;
906
-
907
- pub type LONG_PTR = i64 ; // changed
908
-
909
- pub type LPCWSTR = * WCHAR ;
910
- pub type LPCSTR = * CHAR ;
911
- pub type LPCTSTR = * CHAR ;
912
- pub type LPTCH = * CHAR ;
913
-
914
- pub type LPWSTR = * mut WCHAR ;
915
- pub type LPSTR = * mut CHAR ;
916
- pub type LPTSTR = * mut CHAR ;
917
-
918
- // Not really, but opaque to us.
919
- pub type LPSECURITY_ATTRIBUTES = LPVOID ;
920
-
921
- pub type LPVOID = * mut c_void ;
922
- pub type LPCVOID = * c_void ;
923
- pub type LPBYTE = * mut BYTE ;
924
- pub type LPWORD = * mut WORD ;
925
- pub type LPDWORD = * mut DWORD ;
926
- pub type LPHANDLE = * mut HANDLE ;
927
-
928
- pub type LRESULT = LONG_PTR ;
929
- pub type PBOOL = * mut BOOL ;
930
- pub type WCHAR = wchar_t ;
931
- pub type WORD = u16 ;
932
- pub type SIZE_T = size_t ;
933
-
934
- pub type time64_t = i64 ;
935
- pub type int64 = i64 ;
936
-
937
- pub struct STARTUPINFO {
938
- cb : DWORD ,
939
- lpReserved : LPTSTR ,
940
- lpDesktop : LPTSTR ,
941
- lpTitle : LPTSTR ,
942
- dwX : DWORD ,
943
- dwY : DWORD ,
944
- dwXSize : DWORD ,
945
- dwYSize : DWORD ,
946
- dwXCountChars : DWORD ,
947
- dwYCountCharts : DWORD ,
948
- dwFillAttribute : DWORD ,
949
- dwFlags : DWORD ,
950
- wShowWindow : WORD ,
951
- cbReserved2 : WORD ,
952
- lpReserved2 : LPBYTE ,
953
- hStdInput : HANDLE ,
954
- hStdOutput : HANDLE ,
955
- hStdError : HANDLE
956
- }
957
- pub type LPSTARTUPINFO = * mut STARTUPINFO ;
958
-
959
- pub struct PROCESS_INFORMATION {
960
- hProcess : HANDLE ,
961
- hThread : HANDLE ,
962
- dwProcessId : DWORD ,
963
- dwThreadId : DWORD
964
- }
965
- pub type LPPROCESS_INFORMATION = * mut PROCESS_INFORMATION ;
966
-
967
- pub struct SYSTEM_INFO {
968
- wProcessorArchitecture : WORD ,
969
- wReserved : WORD ,
970
- dwPageSize : DWORD ,
971
- lpMinimumApplicationAddress : LPVOID ,
972
- lpMaximumApplicationAddress : LPVOID ,
973
- dwActiveProcessorMask : DWORD ,
974
- dwNumberOfProcessors : DWORD ,
975
- dwProcessorType : DWORD ,
976
- dwAllocationGranularity : DWORD ,
977
- wProcessorLevel : WORD ,
978
- wProcessorRevision : WORD
979
- }
980
- pub type LPSYSTEM_INFO = * mut SYSTEM_INFO ;
981
-
982
- impl SYSTEM_INFO {
983
- pub fn new ( ) -> SYSTEM_INFO {
984
- SYSTEM_INFO {
985
- wProcessorArchitecture : 0 ,
986
- wReserved : 0 ,
987
- dwPageSize : 0 ,
988
- lpMinimumApplicationAddress : ptr:: mut_null ( ) ,
989
- lpMaximumApplicationAddress : ptr:: mut_null ( ) ,
990
- dwActiveProcessorMask : 0 ,
991
- dwNumberOfProcessors : 0 ,
992
- dwProcessorType : 0 ,
993
- dwAllocationGranularity : 0 ,
994
- wProcessorLevel : 0 ,
995
- wProcessorRevision : 0
996
- }
997
- }
998
- }
999
-
1000
- pub struct MEMORY_BASIC_INFORMATION {
1001
- BaseAddress : LPVOID ,
1002
- AllocationBase : LPVOID ,
1003
- AllocationProtect : DWORD ,
1004
- RegionSize : SIZE_T ,
1005
- State : DWORD ,
1006
- Protect : DWORD ,
1007
- Type : DWORD
1008
- }
1009
- pub type LPMEMORY_BASIC_INFORMATION = * mut MEMORY_BASIC_INFORMATION ;
1010
- }
1011
- }
1012
875
}
1013
876
1014
877
#[ cfg( target_os = "macos" ) ]
@@ -3515,8 +3378,8 @@ pub mod funcs {
3515
3378
pub mod kernel32 {
3516
3379
use libc:: types:: os:: arch:: c95:: { c_uint} ;
3517
3380
use libc:: types:: os:: arch:: extra:: { BOOL , DWORD , SIZE_T , HMODULE } ;
3518
- use libc:: types:: os:: arch:: extra:: { LPCWSTR , LPWSTR , LPCTSTR ,
3519
- LPTSTR , LPTCH , LPDWORD , LPVOID ,
3381
+ use libc:: types:: os:: arch:: extra:: { LPCWSTR , LPWSTR , LPCSTR , LPSTR , LPCH ,
3382
+ LPDWORD , LPVOID ,
3520
3383
LPCVOID , LPOVERLAPPED } ;
3521
3384
use libc:: types:: os:: arch:: extra:: { LPSECURITY_ATTRIBUTES , LPSTARTUPINFO ,
3522
3385
LPPROCESS_INFORMATION ,
@@ -3532,8 +3395,8 @@ pub mod funcs {
3532
3395
-> DWORD ;
3533
3396
pub fn SetEnvironmentVariableW ( n : LPCWSTR , v : LPCWSTR )
3534
3397
-> BOOL ;
3535
- pub fn GetEnvironmentStringsA ( ) -> LPTCH ;
3536
- pub fn FreeEnvironmentStringsA ( env_ptr : LPTCH ) -> BOOL ;
3398
+ pub fn GetEnvironmentStringsA ( ) -> LPCH ;
3399
+ pub fn FreeEnvironmentStringsA ( env_ptr : LPCH ) -> BOOL ;
3537
3400
pub fn GetModuleFileNameW ( hModule : HMODULE ,
3538
3401
lpFilename : LPWSTR ,
3539
3402
nSize : DWORD )
@@ -3572,16 +3435,16 @@ pub mod funcs {
3572
3435
dwProcessId : DWORD )
3573
3436
-> HANDLE ;
3574
3437
pub fn GetCurrentProcess ( ) -> HANDLE ;
3575
- pub fn CreateProcessA ( lpApplicationName : LPCTSTR ,
3576
- lpCommandLine : LPTSTR ,
3438
+ pub fn CreateProcessA ( lpApplicationName : LPCSTR ,
3439
+ lpCommandLine : LPSTR ,
3577
3440
lpProcessAttributes :
3578
3441
LPSECURITY_ATTRIBUTES ,
3579
3442
lpThreadAttributes :
3580
3443
LPSECURITY_ATTRIBUTES ,
3581
3444
bInheritHandles : BOOL ,
3582
3445
dwCreationFlags : DWORD ,
3583
3446
lpEnvironment : LPVOID ,
3584
- lpCurrentDirectory : LPCTSTR ,
3447
+ lpCurrentDirectory : LPCSTR ,
3585
3448
lpStartupInfo : LPSTARTUPINFO ,
3586
3449
lpProcessInformation :
3587
3450
LPPROCESS_INFORMATION )
@@ -3621,7 +3484,7 @@ pub mod funcs {
3621
3484
flProtect : DWORD ,
3622
3485
dwMaximumSizeHigh : DWORD ,
3623
3486
dwMaximumSizeLow : DWORD ,
3624
- lpName : LPCTSTR )
3487
+ lpName : LPCWSTR )
3625
3488
-> HANDLE ;
3626
3489
pub fn MapViewOfFile ( hFileMappingObject : HANDLE ,
3627
3490
dwDesiredAccess : DWORD ,
0 commit comments