Commit ba1a9233 by Rainer Emrich Committed by Kai Tietz

re PR ada/52123 (gcc bootstrap with ada fails on mingw target)

2013-02-06  Rainer Emrich  <rainer@emrich-ebersheim.de>

	PR target/52123
	* adaint.c (__gnat_check_OWNER_ACL): Cast from pointer via
	SECURITY_DESCRIPTOR *
	(__gnat_set_OWNER_ACL): Cast from DWORD to ACCESS_MODE
	(__gnat_portable_spawn): Fix cast to char* const*
	(add_handle): Cast from pointer via void **
	(add_handle): Cast from pointer via int *
	(__gnat_locate_exec_on_path): Cast from pointer via TCHAR *
	(__gnat_locate_exec_on_path): Cast from pointer via char *
	* initialize.c (append_arg): Cast from pointer via LPWSTR
	(__gnat_initialize): Cast from pointer via LPWSTR
	* seh_init.c (__gnat_map_SEH): Cast from pointer via FARPROC

From-SVN: r195803
parent 9bc44bff
2013-02-06 Rainer Emrich <rainer@emrich-ebersheim.de>
PR target/52123
* adaint.c (__gnat_check_OWNER_ACL): Cast from pointer via
SECURITY_DESCRIPTOR *
(__gnat_set_OWNER_ACL): Cast from DWORD to ACCESS_MODE
(__gnat_portable_spawn): Fix cast to char* const*
(add_handle): Cast from pointer via void **
(add_handle): Cast from pointer via int *
(__gnat_locate_exec_on_path): Cast from pointer via TCHAR *
(__gnat_locate_exec_on_path): Cast from pointer via char *
* initialize.c (append_arg): Cast from pointer via LPWSTR
(__gnat_initialize): Cast from pointer via LPWSTR
* seh_init.c (__gnat_map_SEH): Cast from pointer via FARPROC
2013-02-06 Hristian Kirtchev <kirtchev@adacore.com> 2013-02-06 Hristian Kirtchev <kirtchev@adacore.com>
* gcc-interface/Make-lang.in: Enable System.Stack_Checking.Operations * gcc-interface/Make-lang.in: Enable System.Stack_Checking.Operations
......
...@@ -1982,7 +1982,7 @@ __gnat_check_OWNER_ACL ...@@ -1982,7 +1982,7 @@ __gnat_check_OWNER_ACL
GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION, GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION,
NULL, 0, &nLength); NULL, 0, &nLength);
if ((pSD = (PSECURITY_DESCRIPTOR) HeapAlloc if ((pSD = (SECURITY_DESCRIPTOR *) HeapAlloc
(GetProcessHeap (), HEAP_ZERO_MEMORY, nLength)) == NULL) (GetProcessHeap (), HEAP_ZERO_MEMORY, nLength)) == NULL)
return 0; return 0;
...@@ -2059,7 +2059,7 @@ __gnat_set_OWNER_ACL ...@@ -2059,7 +2059,7 @@ __gnat_set_OWNER_ACL
return; return;
BuildExplicitAccessWithName BuildExplicitAccessWithName
(&ea, username, AccessPermissions, AccessMode, NO_INHERITANCE); (&ea, username, AccessPermissions, (ACCESS_MODE) AccessMode, NO_INHERITANCE);
if (AccessMode == SET_ACCESS) if (AccessMode == SET_ACCESS)
{ {
...@@ -2384,7 +2384,7 @@ __gnat_portable_spawn (char *args[]) ...@@ -2384,7 +2384,7 @@ __gnat_portable_spawn (char *args[])
strcat (args[0], args_0); strcat (args[0], args_0);
strcat (args[0], "\""); strcat (args[0], "\"");
status = spawnvp (P_WAIT, args_0, (const char* const*)args); status = spawnvp (P_WAIT, args_0, (char* const*)args);
/* restore previous value */ /* restore previous value */
free (args[0]); free (args[0]);
...@@ -2540,9 +2540,9 @@ add_handle (HANDLE h, int pid) ...@@ -2540,9 +2540,9 @@ add_handle (HANDLE h, int pid)
{ {
plist_max_length += 1000; plist_max_length += 1000;
HANDLES_LIST = HANDLES_LIST =
xrealloc (HANDLES_LIST, sizeof (HANDLE) * plist_max_length); (void **) xrealloc (HANDLES_LIST, sizeof (HANDLE) * plist_max_length);
PID_LIST = PID_LIST =
xrealloc (PID_LIST, sizeof (int) * plist_max_length); (int *) xrealloc (PID_LIST, sizeof (int) * plist_max_length);
} }
HANDLES_LIST[plist_length] = h; HANDLES_LIST[plist_length] = h;
...@@ -2931,7 +2931,7 @@ __gnat_locate_exec_on_path (char *exec_name) ...@@ -2931,7 +2931,7 @@ __gnat_locate_exec_on_path (char *exec_name)
#define EXPAND_BUFFER_SIZE 32767 #define EXPAND_BUFFER_SIZE 32767
wapath_val = alloca (EXPAND_BUFFER_SIZE); wapath_val = (TCHAR *) alloca (EXPAND_BUFFER_SIZE);
wapath_val [0] = '.'; wapath_val [0] = '.';
wapath_val [1] = ';'; wapath_val [1] = ';';
...@@ -2941,7 +2941,7 @@ __gnat_locate_exec_on_path (char *exec_name) ...@@ -2941,7 +2941,7 @@ __gnat_locate_exec_on_path (char *exec_name)
if (!res) wapath_val [0] = _T('\0'); if (!res) wapath_val [0] = _T('\0');
apath_val = alloca (EXPAND_BUFFER_SIZE); apath_val = (char *) alloca (EXPAND_BUFFER_SIZE);
WS2SC (apath_val, wapath_val, EXPAND_BUFFER_SIZE); WS2SC (apath_val, wapath_val, EXPAND_BUFFER_SIZE);
return __gnat_locate_exec (exec_name, apath_val); return __gnat_locate_exec (exec_name, apath_val);
......
...@@ -88,14 +88,14 @@ append_arg (int *index, LPWSTR dir, LPWSTR value, ...@@ -88,14 +88,14 @@ append_arg (int *index, LPWSTR dir, LPWSTR value,
{ {
/* no dir prefix */ /* no dir prefix */
dirlen = 0; dirlen = 0;
fullvalue = xmalloc ((vallen + 1) * sizeof(TCHAR)); fullvalue = (LPWSTR) xmalloc ((vallen + 1) * sizeof(TCHAR));
} }
else else
{ {
/* Add dir first */ /* Add dir first */
dirlen = _tcslen (dir); dirlen = _tcslen (dir);
fullvalue = xmalloc ((dirlen + vallen + 1) * sizeof(TCHAR)); fullvalue = (LPWSTR) xmalloc ((dirlen + vallen + 1) * sizeof(TCHAR));
_tcscpy (fullvalue, dir); _tcscpy (fullvalue, dir);
} }
...@@ -203,7 +203,7 @@ __gnat_initialize (void *eh ATTRIBUTE_UNUSED) ...@@ -203,7 +203,7 @@ __gnat_initialize (void *eh ATTRIBUTE_UNUSED)
if (ldir != NULL) if (ldir != NULL)
{ {
int n = ldir - wargv[k] + 1; int n = ldir - wargv[k] + 1;
dir = xmalloc ((n + 1) * sizeof (TCHAR)); dir = (LPWSTR) xmalloc ((n + 1) * sizeof (TCHAR));
_tcsncpy (dir, wargv[k], n); _tcsncpy (dir, wargv[k], n);
dir[n] = _T('\0'); dir[n] = _T('\0');
} }
......
...@@ -91,7 +91,7 @@ __gnat_map_SEH (EXCEPTION_RECORD* ExceptionRecord, const char **msg) ...@@ -91,7 +91,7 @@ __gnat_map_SEH (EXCEPTION_RECORD* ExceptionRecord, const char **msg)
*/ */
if ((ExceptionRecord->ExceptionInformation[1] & 3) != 0 if ((ExceptionRecord->ExceptionInformation[1] & 3) != 0
|| IsBadCodePtr || IsBadCodePtr
((void *)(ExceptionRecord->ExceptionInformation[1] + 4096))) ((FARPROC)(ExceptionRecord->ExceptionInformation[1] + 4096)))
{ {
*msg = "EXCEPTION_ACCESS_VIOLATION"; *msg = "EXCEPTION_ACCESS_VIOLATION";
return &program_error; return &program_error;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment