Add some ARM specific code paths, cleanup a bit stralign.h, and add missing language & sublanguage defines

git-svn-id: svn+ssh://svn.code.sf.net/p/mingw-w64/code/trunk@5630 4407c894-4637-0410-b4f5-ada5f102cad1
This commit is contained in:
Kai Tietz 2013-03-10 12:47:49 +00:00
parent 87474a7038
commit b1ea79bd6c
5 changed files with 98 additions and 5 deletions

View File

@ -117,7 +117,7 @@
#undef UNALIGNED /* avoid redefinition warnings vs _mingw.h */
#undef UNALIGNED64
#if defined(_M_MRX000) || defined(_M_ALPHA) || defined(_M_PPC) || defined(_M_IA64) || defined(_M_AMD64)
#if defined(_M_MRX000) || defined(_M_ALPHA) || defined(_M_PPC) || defined(_M_IA64) || defined(_M_AMD64) || defined (_M_ARM)
#define ALIGNMENT_MACHINE
#define UNALIGNED __unaligned
#if defined(_WIN64)
@ -161,6 +161,12 @@
#define TYPE_ALIGNMENT(t) FIELD_OFFSET(struct { char x; t test; }, test)
#endif
#if defined (_X86_) || defined (_AMD64_)
#define PROBE_ALIGNMENT(v) TYPE_ALIGNMENT(ULONG)
#elif defined (_IA64_) || defined (_ARM_)
#define PROBE_ALIGNMENT(v) (TYPE_ALIGNMENT(v) > TYPE_ALIGNMENT(ULONG) ? TYPE_ALIGNMENT(v) : TYPE_ALIGNMENT(ULONG))
#endif
/* Calling Conventions */
#if defined(_M_IX86)
#define FASTCALL __fastcall

View File

@ -28,7 +28,11 @@ extern "C" {
#if defined(__ia64__) || defined(__x86_64)
#define __RPC_WIN64__
#else
#if !defined (_ARM_)
#define __RPC_WIN32__
#else
#define __RPC_ARM32__
#endif
#endif
#ifdef __RPC_WIN64__
@ -68,11 +72,16 @@ extern "C" {
#endif
#include <rpcdce.h>
#ifndef _KRPCENV_
#include <rpcnsi.h>
#endif
#include <rpcnterr.h>
#include <excpt.h>
#include <winerror.h>
/* TODO: This isn't actual working on gcc. Either we need to implement
their __try/__except/__finally feature, or we need to do at least for x64
emulation-code via inline-assembler ... */
#define RpcTryExcept __try {
#define RpcExcept(expr) } __except(expr) {
#define RpcEndExcept }

View File

@ -42,6 +42,16 @@ extern "C" {
#define NDR_LOCAL_DATA_REPRESENTATION __MSABI_LONG(0X00000010U)
#define NDR_LOCAL_ENDIAN NDR_LITTLE_ENDIAN
#if _WIN32_WINNT >= 0x601
#define TARGET_IS_NT61_OR_LATER 1
#else
#define TARGET_IS_NT61_OR_LATER 0
#endif
#if _WIN32_WINNT >= 0x600
#define TARGET_IS_NT60_OR_LATER 1
#else
#define TARGET_IS_NT60_OR_LATER 0
#endif
#define TARGET_IS_NT51_OR_LATER 1
#define TARGET_IS_NT50_OR_LATER 1
#define TARGET_IS_NT40_OR_LATER 1
@ -648,6 +658,9 @@ typedef unsigned __LONG32 error_status_t;
RPCRTAPI void RPC_ENTRY NdrFreeBuffer(PMIDL_STUB_MESSAGE pStubMsg);
RPCRTAPI RPC_STATUS RPC_ENTRY NdrGetDcomProtocolVersion(PMIDL_STUB_MESSAGE pStubMsg,RPC_VERSION *pVersion);
CLIENT_CALL_RETURN RPC_VAR_ENTRY NdrClientCall2(PMIDL_STUB_DESC pStubDescriptor,PFORMAT_STRING pFormat,...);
#if defined (__arm__)
CLIENT_CALL_RETURN RPC_VAR_ENTRY NdrpClientCall2(PMIDL_STUB_DESC pStubDescriptor, PFORMAT_STRING pFormat, unsigned char *StartofStack);
#endif
CLIENT_CALL_RETURN RPC_VAR_ENTRY NdrClientCall(PMIDL_STUB_DESC pStubDescriptor,PFORMAT_STRING pFormat,...);
CLIENT_CALL_RETURN RPC_VAR_ENTRY NdrAsyncClientCall(PMIDL_STUB_DESC pStubDescriptor,PFORMAT_STRING pFormat,...);
CLIENT_CALL_RETURN RPC_VAR_ENTRY NdrDcomAsyncClientCall(PMIDL_STUB_DESC pStubDescriptor,PFORMAT_STRING pFormat,...);

View File

@ -14,8 +14,12 @@
extern "C" {
#endif
#if defined(_X86_)
#if defined (__amd64__) || defined (__arm__)
#define WSTR_ALIGNED(s) TRUE
#else
#define WSTR_ALIGNED(s) (((DWORD_PTR)(s) & 1) == 0)
#endif
#if defined(_X86_)
#define ua_CharUpperW CharUpperW
#define ua_lstrcmpiW lstrcmpiW
#define ua_lstrcmpW lstrcmpW
@ -156,7 +160,7 @@ extern "C" {
#define __UA_WSTRSIZE(s) ((__UA_WCSLEN(s)+1)*sizeof(WCHAR))
#define __UA_STACKCOPY(p,s) memcpy(_alloca(s),p,s)
#ifdef _X86_
#if defined (__amd64__) || defined (__arm__) || defined (_X86_)
#define WSTR_ALIGNED_STACK_COPY(d,s) (*(d) = (PCWSTR)(s))
#else
#define WSTR_ALIGNED_STACK_COPY(d,s) { PCUWSTR __ua_src; ULONG __ua_size; PWSTR __ua_dst; __ua_src = (s); if(WSTR_ALIGNED(__ua_src)) { __ua_dst = (PWSTR)__ua_src; } else { __ua_size = __UA_WSTRSIZE(__ua_src); __ua_dst = (PWSTR)_alloca(__ua_size); memcpy(__ua_dst,__ua_src,__ua_size); } *(d) = (PCWSTR)__ua_dst; }
@ -164,7 +168,7 @@ extern "C" {
#define ASTR_ALIGNED_STACK_COPY(d,s) (*(d) = (PCSTR)(s))
#ifndef _X86_
#if !defined (_X86_) && !defined (__amd64__) && !defined (__arm__)
#define __UA_STRUC_ALIGNED(t,s) (((DWORD_PTR)(s) & (TYPE_ALIGNMENT(t)-1))==0)
#define STRUC_ALIGNED_STACK_COPY(t,s) __UA_STRUC_ALIGNED(t,s) ? ((t const *)(s)) : ((t const *)__UA_STACKCOPY((s),sizeof(t)))
#else

View File

@ -614,6 +614,29 @@ inline ENUMTYPE &operator ^= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((i
#define PRODUCT_PROFESSIONAL_E 0x45
#define PRODUCT_ENTERPRISE_E 0x46
#define PRODUCT_ULTIMATE_E 0x47
#define PRODUCT_ENTERPRISE_EVALUATION 0x48
#define PRODUCT_MULTIPOINT_STANDARD_SERVER 0x4C
#define PRODUCT_MULTIPOINT_PREMIUM_SERVER 0x4D
#define PRODUCT_STANDARD_EVALUATION_SERVER 0x4F
#define PRODUCT_DATACENTER_EVALUATION_SERVER 0x50
#define PRODUCT_ENTERPRISE_N_EVALUATION 0x54
#define PRODUCT_EMBEDDED_AUTOMOTIVE 0x55
#define PRODUCT_EMBEDDED_INDUSTRY_A 0x56
#define PRODUCT_THINPC 0x57
#define PRODUCT_EMBEDDED_A 0x58
#define PRODUCT_EMBEDDED_INDUSTRY 0x59
#define PRODUCT_EMBEDDED_E 0x5A
#define PRODUCT_EMBEDDED_INDUSTRY_E 0x5B
#define PRODUCT_EMBEDDED_INDUSTRY_A_E 0x5C
#define PRODUCT_STORAGE_WORKGROUP_EVALUATION_SERVER 0x5F
#define PRODUCT_STORAGE_STANDARD_EVALUATION_SERVER 0x60
#define PRODUCT_CORE_ARM 0x61
#define PRODUCT_CORE_N 0x62
#define PRODUCT_CORE_COUNTRYSPECIFIC 0x63
#define PRODUCT_CORE_SINGLELANGUAGE 0x64
#define PRODUCT_CORE 0x65
#define PRODUCT_PROFESSIONAL_WMC 0x67
#define PRODUCT_MOBILE_CORE 0x68
#define PRODUCT_UNLICENSED 0xabcdabcd
@ -628,6 +651,8 @@ inline ENUMTYPE &operator ^= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((i
#define LANG_ARMENIAN 0x2b
#define LANG_ASSAMESE 0x4d
#define LANG_AZERI 0x2c
#define LANG_AZERBAIJANI 0x2c
#define LANG_BANGLA 0x45
#define LANG_BASHKIR 0x6d
#define LANG_BASQUE 0x2d
#define LANG_BELARUSIAN 0x23
@ -637,6 +662,8 @@ inline ENUMTYPE &operator ^= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((i
#define LANG_BOSNIAN_NEUTRAL 0x781a
#define LANG_BULGARIAN 0x02
#define LANG_CATALAN 0x03
#define LANG_CENTRAL_KURDISH 0x92
#define LANG_CHEROKEE 0x5c
#define LANG_CHINESE 0x04
#define LANG_CHINESE_SIMPLIFIED 0x04
#define LANG_CHINESE_TRADITIONAL 0x7c04
@ -655,6 +682,7 @@ inline ENUMTYPE &operator ^= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((i
#define LANG_FINNISH 0x0b
#define LANG_FRENCH 0x0c
#define LANG_FRISIAN 0x62
#define LANG_FULAH 0x67
#define LANG_GALICIAN 0x56
#define LANG_GEORGIAN 0x37
#define LANG_GERMAN 0x07
@ -699,18 +727,22 @@ inline ENUMTYPE &operator ^= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((i
#define LANG_NEPALI 0x61
#define LANG_NORWEGIAN 0x14
#define LANG_OCCITAN 0x82
#define LANG_ODIA 0x48
#define LANG_ORIYA 0x48
#define LANG_PASHTO 0x63
#define LANG_PERSIAN 0x29
#define LANG_POLISH 0x15
#define LANG_PORTUGUESE 0x16
#define LANG_PULAR 0x67
#define LANG_PUNJABI 0x46
#define LANG_QUECHUA 0x6b
#define LANG_ROMANIAN 0x18
#define LANG_ROMANSH 0x17
#define LANG_RUSSIAN 0x19
#define LANG_SAKHA 0x85
#define LANG_SAMI 0x3b
#define LANG_SANSKRIT 0x4f
#define LANG_SCOTTISH_GAELIC 0x91
#define LANG_SERBIAN 0x1a
#define LANG_SERBIAN_NEUTRAL 0x7c1a
#define LANG_SINDHI 0x59
@ -730,6 +762,7 @@ inline ENUMTYPE &operator ^= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((i
#define LANG_THAI 0x1e
#define LANG_TIBETAN 0x51
#define LANG_TIGRIGNA 0x73
#define LANG_TIGRINYA 0x73
#define LANG_TSWANA 0x32
#define LANG_TURKISH 0x1f
#define LANG_TURKMEN 0x42
@ -738,6 +771,7 @@ inline ENUMTYPE &operator ^= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((i
#define LANG_UPPER_SORBIAN 0x2e
#define LANG_URDU 0x20
#define LANG_UZBEK 0x43
#define LANG_VALENCIAN 0x03
#define LANG_VIETNAMESE 0x2a
#define LANG_WELSH 0x52
#define LANG_WOLOF 0x88
@ -778,6 +812,10 @@ inline ENUMTYPE &operator ^= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((i
#define SUBLANG_ASSAMESE_INDIA 0x01
#define SUBLANG_AZERI_LATIN 0x01
#define SUBLANG_AZERI_CYRILLIC 0x02
#define SUBLANG_AZERBAIJANI_AZERBAIJAN_LATIN 0x01
#define SUBLANG_AZERBAIJANI_AZERBAIJAN_CYRILLIC 0x02
#define SUBLANG_BANGLA_INDIA 0x01
#define SUBLANG_BANGLA_BANGLADESH 0x02
#define SUBLANG_BASHKIR_RUSSIA 0x01
#define SUBLANG_BASQUE_BASQUE 0x01
#define SUBLANG_BELARUSIAN_BELARUS 0x01
@ -788,6 +826,8 @@ inline ENUMTYPE &operator ^= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((i
#define SUBLANG_BRETON_FRANCE 0x01
#define SUBLANG_BULGARIAN_BULGARIA 0x01
#define SUBLANG_CATALAN_CATALAN 0x01
#define SUBLANG_CENTRAL_KURDISH_IRAQ 0x01
#define SUBLANG_CHEROKEE_CHEROKEE 0x01
#define SUBLANG_CHINESE_TRADITIONAL 0x01
#define SUBLANG_CHINESE_SIMPLIFIED 0x02
#define SUBLANG_CHINESE_HONGKONG 0x03
@ -798,6 +838,7 @@ inline ENUMTYPE &operator ^= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((i
#define SUBLANG_CROATIAN_CROATIA 0x01
#define SUBLANG_CROATIAN_BOSNIA_HERZEGOVINA_LATIN 0x04
#define SUBLANG_DANISH_DENMARK 0x01
#define SUBLANG_DARI_AFGHANISTAN 0x01
#define SUBLANG_DIVEHI_MALDIVES 0x01
#define SUBLANG_DUTCH 0x01
#define SUBLANG_DUTCH_BELGIAN 0x02
@ -831,6 +872,7 @@ inline ENUMTYPE &operator ^= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((i
#define SUBLANG_FRENCH_LUXEMBOURG 0x05
#define SUBLANG_FRENCH_MONACO 0x06
#define SUBLANG_FRISIAN_NETHERLANDS 0x01
#define SUBLANG_FULAH_SENEGAL 0x02
#define SUBLANG_GALICIAN_GALICIAN 0x01
#define SUBLANG_GEORGIAN_GEORGIA 0x01
#define SUBLANG_GERMAN 0x01
@ -843,6 +885,7 @@ inline ENUMTYPE &operator ^= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((i
#define SUBLANG_GUJARATI_INDIA 0x01
#define SUBLANG_HAUSA_NIGERIA_LATIN 0x01
#define SUBLANG_HAUSA_NIGERIA SUBLANG_HAUSA_NIGERIA_LATIN /* SUBLANG_HAUSA_NIGERIA_LATIN is what MS defines */
#define SUBLANG_HAWAIIAN_US 0x01
#define SUBLANG_HEBREW_ISRAEL 0x01
#define SUBLANG_HINDI_INDIA 0x01
#define SUBLANG_HUNGARIAN_HUNGARY 0x01
@ -855,6 +898,7 @@ inline ENUMTYPE &operator ^= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((i
#define SUBLANG_ITALIAN 0x01
#define SUBLANG_ITALIAN_SWISS 0x02
#define SUBLANG_JAPANESE_JAPAN 0x01
#define SUBLANG_KANNADA_INDIA 0x01
#define SUBLANG_KASHMIRI_INDIA 0x02
#define SUBLANG_KASHMIRI_SASIA 0x02
#define SUBLANG_KAZAK_KAZAKHSTAN 0x01
@ -898,8 +942,9 @@ inline ENUMTYPE &operator ^= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((i
#define SUBLANG_PORTUGUESE_PORTUGAL 0x02
#endif /* WINVER >= 0x0600 */
#define SUBLANG_PORTUGUESE 0x02
#define SUBLANG_PULAR_SENEGAL 0x02
#define SUBLANG_PUNJABI_INDIA 0x01
/* ??? #define SUBLANG_PUNJABI_PAKISTAN 0x01 ??? */
#define SUBLANG_PUNJABI_PAKISTAN 0x02
#define SUBLANG_QUECHUA_BOLIVIA 0x01
#define SUBLANG_QUECHUA_ECUADOR 0x02
#define SUBLANG_QUECHUA_PERU 0x03
@ -907,6 +952,7 @@ inline ENUMTYPE &operator ^= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((i
/* ??? #define SUBLANG_ROMANIAN_MOLDOVA 0x01 ??? */
#define SUBLANG_ROMANSH_SWITZERLAND 0x01
#define SUBLANG_RUSSIAN_RUSSIA 0x01
#define SUBLANG_SAKHA_RUSSIA 0x01
#define SUBLANG_SAMI_NORTHERN_NORWAY 0x01
#define SUBLANG_SAMI_NORTHERN_SWEDEN 0x02
#define SUBLANG_SAMI_NORTHERN_FINLAND 0x03
@ -917,11 +963,18 @@ inline ENUMTYPE &operator ^= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((i
#define SUBLANG_SAMI_SKOLT_FINLAND 0x08
#define SUBLANG_SAMI_INARI_FINLAND 0x09
#define SUBLANG_SANSKRIT_INDIA 0x01
define SUBLANG_SCOTTISH_GAELIC 0x01
#define SUBLANG_SERBIAN_LATIN 0x02
#define SUBLANG_SERBIAN_CYRILLIC 0x03
#define SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_LATIN 0x06
#define SUBLANG_SERBIAN_BOSNIA_HERZEGOVINA_CYRILLIC 0x07
#define SUBLANG_SERBIAN_MONTENEGRO_LATIN 0x0b
#define SUBLANG_SERBIAN_MONTENEGRO_CYRILLIC 0x0c
#define SUBLANG_SERBIAN_SERBIA_LATIN 0x09
#define SUBLANG_SERBIAN_SERBIA_CYRILLIC 0x0a
#define SUBLANG_SINDHI_INDIA 0x01
#define SUBLANG_SINDHI_AFGHANISTAN 0x02
#define SUBLANG_SINDHI_PAKISTAN 0x02
#define SUBLANG_SINHALESE_SRI_LANKA 0x01
#define SUBLANG_SOTHO_NORTHERN_SOUTH_AFRICA 0x01
#define SUBLANG_SLOVAK_SLOVAKIA 0x01
@ -947,6 +1000,7 @@ inline ENUMTYPE &operator ^= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((i
#define SUBLANG_SPANISH_NICARAGUA 0x13
#define SUBLANG_SPANISH_PUERTO_RICO 0x14
#define SUBLANG_SPANISH_US 0x15
#define SUBLANG_SWAHILI_KENYA 0x01
#if (WINVER >= 0x0600)
#define SUBLANG_SWEDISH_SWEDEN 0x01
#endif /* WINVER >= 0x0600 */
@ -956,13 +1010,18 @@ inline ENUMTYPE &operator ^= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((i
#define SUBLANG_SYRIAC_SYRIA SUBLANG_SYRIAC /* SUBLANG_SYRIAC_SYRIA is what MSDN mentions */
#define SUBLANG_TAJIK_TAJIKISTAN 0x01
#define SUBLANG_TAMAZIGHT_ALGERIA_LATIN 0x02
#define SUBLANG_TAMAZIGHT_MOROCCO_TIFINAGH 0x04
#define SUBLANG_TAMIL_INDIA 0x01
#define SUBLANG_TAMIL_SRI_LANKA 0x02
#define SUBLANG_TATAR_RUSSIA 0x01
#define SUBLANG_TELUGU_INDIA 0x01
#define SUBLANG_THAI_THAILAND 0x01
#define SUBLANG_TIBETAN_PRC 0x01
#define SUBLANG_TIBETAN_BHUTAN 0x02
#define SUBLANG_TIGRIGNA_ERITREA 0x02
#define SUBLANG_TIGRINYA_ERITREA 0x02
#define SUBLANG_TIGRINYA_ETHIOPIA 0x01
#define SUBLANG_TSWANA_BOTSWANA 0x02
#define SUBLANG_TSWANA_SOUTH_AFRICA 0x01
#define SUBLANG_TURKISH_TURKEY 0x01
#define SUBLANG_TURKMEN_TURKMENISTAN 0x01
@ -973,6 +1032,7 @@ inline ENUMTYPE &operator ^= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((i
#define SUBLANG_URDU_INDIA 0x02
#define SUBLANG_UZBEK_LATIN 0x01
#define SUBLANG_UZBEK_CYRILLIC 0x02
#define SUBLANG_VALENCIAN_VALENCIA 0x02
#define SUBLANG_VIETNAMESE_VIETNAM 0x01
#define SUBLANG_WELSH_UNITED_KINGDOM 0x01
#define SUBLANG_WOLOF_SENEGAL 0x01
@ -994,6 +1054,7 @@ inline ENUMTYPE &operator ^= (ENUMTYPE &a, ENUMTYPE b) { return (ENUMTYPE &)(((i
#define SORT_CHINESE_UNICODE 0x1
#define SORT_CHINESE_PRC 0x2
#define SORT_CHINESE_BOPOMOFO 0x3
#define SORT_CHINESE_RADICALSTROKE 0x4
#define SORT_KOREAN_KSC 0x0
#define SORT_KOREAN_UNICODE 0x1