bugzilla 4398 dmd always uses Windows name mangling for _d_throw

This commit is contained in:
Walter Bright 2010-10-25 05:12:00 +00:00
parent c8631707a6
commit cd2287f201
2 changed files with 37 additions and 9 deletions

View file

@ -1,10 +1,19 @@
//
// Copyright (c) 1999-2003 by Digital Mars, www.digitalmars.com
// Copyright (c) 1999-2010 by Digital Mars, http://www.digitalmars.com
// All Rights Reserved
// Written by Walter Bright
// Exception handling support
/* deh.c is Windows only. It is in C because it interacts with all the complex Windows header
* definitions for Windows SEH that have not been ported to D. D's eh mechanism on Windows is
* layered on top of Windows SEH.
*
* For other platforms, deh2.d is used instead, as D uses its own invented exception handling
* mechanism. (It is not compatible with the C++ eh ELF mechanism.)
*/
#include <stdio.h>
#include <string.h>
#include <assert.h>
@ -214,7 +223,7 @@ int _d_exception_filter(struct _EXCEPTION_POINTERS *eptrs,
* Throw a D object.
*/
void __stdcall _d_throw(Object *h)
void _d_throwc(Object *h)
{
//printf("_d_throw(h = %p, &h = %p)\n", h, &h);
//printf("\tvptr = %p\n", *(void **)h);
@ -223,6 +232,11 @@ void __stdcall _d_throw(Object *h)
1, (DWORD *)&h);
}
void __stdcall _d_throw(Object *h)
{
_d_throwc(h);
}
/***********************************
* Create an exception object
*/

View file

@ -2,16 +2,20 @@
* Implementation of exception handling support routines for Posix.
*
* Copyright: Copyright Digital Mars 2000 - 2010.
* License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>.
* Authors: Walter Bright
*
* Copyright Digital Mars 2000 - 2009.
* License:
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
* $(LINK http://www.boost.org/LICENSE_1_0.txt))
* Authors: Walter Bright
*/
// Exception handling support for linux
/* deh.c is Windows only. It is in C because it interacts with all the complex Windows header
* definitions for Windows SEH that have not been ported to D. D's eh mechanism on Windows is
* layered on top of Windows SEH.
*
* For other platforms, deh2.d is used instead, as D uses its own invented exception handling
* mechanism. (It is not compatible with the C++ eh ELF mechanism.)
*/
//debug=1;
@ -134,10 +138,20 @@ size_t __eh_find_caller(size_t regbp, size_t *pretaddr)
}
/***********************************
* Throw a D object.
* Deprecated because of Bugzilla 4398,
* keep for the moment for backwards compatibility.
*/
extern (Windows) void _d_throw(Object *h)
{
_d_throwc(h);
}
/***********************************
* Throw a D object.
*/
extern (C) void _d_throwc(Object *h)
{
size_t regebp;