Synchronize with trunk.

svn path=/branches/ntvdm/; revision=59499
This commit is contained in:
Aleksandar Andrejevic 2013-07-18 00:46:28 +00:00
commit fb7355f834
594 changed files with 76378 additions and 29859 deletions

View file

@ -1,5 +1,8 @@
add_subdirectory(comsupp)
if(MSVC)
add_subdirectory(cpprt)
endif()
add_subdirectory(crt)
add_subdirectory(delayimp)
add_subdirectory(dxguid)

View file

@ -1,5 +1,5 @@
set_cpp()
set_cpp(WITH_EXCEPTIONS WITH_STL)
add_library(comsupp comsupp.cpp)
add_dependencies(comsupp psdk)

View file

@ -0,0 +1,9 @@
set_cpp(WITH_EXCEPTIONS)
list(APPEND SOURCE
ehvec.cpp
typeinfo.cpp)
add_asm_files(cpprt_asm i386/cpprt.s)
add_library(cpprt ${SOURCE} ${cpprt_asm})

48
lib/sdk/cpprt/ehvec.cpp Normal file
View file

@ -0,0 +1,48 @@
/*
* PROJECT: ReactOS c++ runtime library
* LICENSE: GPLv2+ - See COPYING in the top level directory
* PURPOSE: Exception-handling vector ctor/dtor iterator implementation
* PROGRAMMER: Thomas Faber (thomas.faber@reactos.org)
*/
#include <stddef.h>
void __stdcall MSVCRTEX_eh_vector_constructor_iterator(void *pMem, size_t sizeOfItem, int nItems, void (__thiscall *ctor)(void *), void (__thiscall *dtor)(void *))
{
char *pEnd = static_cast<char *>(pMem) + nItems * sizeOfItem;
for (char *pItem = static_cast<char *>(pMem);
pItem < pEnd;
pItem += sizeOfItem)
{
try
{
ctor(pItem);
}
catch (...)
{
for (pItem -= sizeOfItem; pItem >= pMem; pItem -= sizeOfItem)
dtor(pItem);
throw;
}
}
}
void __stdcall MSVCRTEX_eh_vector_destructor_iterator(void *pMem, size_t sizeOfItem, int nItems, void (__thiscall *dtor)(void *))
{
char *pEnd = static_cast<char *>(pMem) + nItems * sizeOfItem;
for (char *pItem = pEnd - sizeOfItem;
pItem >= pMem;
pItem -= sizeOfItem)
{
try
{
dtor(pItem);
}
catch (...)
{
for (pItem -= sizeOfItem; pItem >= pMem; pItem -= sizeOfItem)
dtor(pItem);
throw;
}
}
}

View file

@ -0,0 +1,16 @@
#include <asm.inc>
.code
MACRO(DEFINE_ALIAS, alias, orig, type)
EXTERN &orig:&type
ALIAS <&alias> = <&orig>
ENDM
; void __stdcall `eh vector constructor iterator'(void *,unsigned int,int,void (__thiscall*)(void *),void (__thiscall*)(void *))
DEFINE_ALIAS ??_L@YGXPAXIHP6EX0@Z1@Z, ?MSVCRTEX_eh_vector_constructor_iterator@@YGXPAXIHP6EX0@Z1@Z
; void __stdcall `eh vector destructor iterator'(void *,unsigned int,int,void (__thiscall*)(void *))
DEFINE_ALIAS ??_M@YGXPAXIHP6EX0@Z@Z, ?MSVCRTEX_eh_vector_destructor_iterator@@YGXPAXIHP6EX0@Z@Z
END

View file

@ -0,0 +1,27 @@
/*
* PROJECT: ReactOS c++ runtime library
* LICENSE: GPLv2+ - See COPYING in the top level directory
* PURPOSE: Type info stub implementation
* PROGRAMMER: Thomas Faber (thomas.faber@reactos.org)
*/
/* TODO: #include <exception> instead */
class type_info {
public:
__declspec(dllimport) virtual ~type_info();
private:
type_info(const type_info &);
type_info &operator=(const type_info &);
};
/* These stubs don't need to do anything (those private functions are never
* called). They need to be in cpprt, though, in order to have the vtable
* and generated destructor thunks available to programs */
type_info::type_info(const type_info &)
{
}
type_info &type_info::operator=(const type_info &)
{
return *this;
}

View file

@ -214,6 +214,8 @@ int SetEnv(const wchar_t *option)
wchar_t *woption;
char *mboption;
int remove, index, count, size, result = 0, found = 0;
wchar_t **wnewenv;
char **mbnewenv;
if (option == NULL || (epos = wcschr(option, L'=')) == NULL)
return -1;
@ -261,14 +263,18 @@ int SetEnv(const wchar_t *option)
free(*wenvptr);
for (count = index; *wenvptr != NULL; wenvptr++, count++)
*wenvptr = *(wenvptr + 1);
_wenviron = realloc(_wenviron, count * sizeof(wchar_t*));
wnewenv = realloc(_wenviron, count * sizeof(wchar_t*));
if (wnewenv != NULL)
_wenviron = wnewenv;
/* Remove the option from multibyte environment. We assume
* the environments are in sync and the option is at the
* same position. */
free(_environ[index]);
memmove(&_environ[index], &_environ[index+1], (count - index) * sizeof(char*));
_environ = realloc(_environ, count * sizeof(char*));
mbnewenv = realloc(_environ, count * sizeof(char*));
if (mbnewenv != NULL)
_environ = mbnewenv;
result = SetEnvironmentVariableW(name, NULL) ? 0 : -1;
}
@ -303,9 +309,6 @@ int SetEnv(const wchar_t *option)
}
else
{
wchar_t **wnewenv;
char **mbnewenv;
/* Get the size of the original environment. */
for (count = index; *wenvptr != NULL; wenvptr++, count++)
;

View file

@ -279,7 +279,7 @@ _FUNCTION_ {
/* handle exponent */
if (width!=0 && (nch == 'e' || nch == 'E')) {
int exponent = 0, negexp = 0;
float expcnt;
double expcnt, shift;
nch = _GETC_(file);
if (width>0) width--;
/* possible sign on the exponent */
@ -296,13 +296,15 @@ _FUNCTION_ {
if (width>0) width--;
}
/* update 'cur' with this exponent. */
expcnt = negexp ? 0.1f : 10.0f;
expcnt = 10;
shift = 1.0;
while (exponent!=0) {
if (exponent&1)
cur*=expcnt;
shift *= expcnt;
exponent/=2;
expcnt=expcnt*expcnt;
}
cur = (negexp ? cur / shift : cur * shift);
}
st = 1;
if (!suppress) {

View file

@ -29,7 +29,6 @@ DEFINE_GUID(CLSID_TF_InputProcessorProfiles, 0x33c53a50,0xf456,0x4884,0xb0,0x49,
DEFINE_GUID(CLSID_TF_CategoryMgr, 0xA4B544A1,0x438D,0x4B41,0x93,0x25,0x86,0x95,0x23,0xE2,0xD6,0xC7);
DEFINE_GUID(CLSID_TF_LangBarMgr, 0xebb08c45,0x6c4a,0x4fdc,0xae,0x53,0x4e,0xb8,0xc4,0xc7,0xdb,0x8e);
DEFINE_GUID(CLSID_TF_DisplayAttributeMgr, 0x3ce74de4,0x53d3,0x4d74,0x8b,0x83,0x43,0x1b,0x38,0x28,0xba,0x53);
DEFINE_GUID(CLSID_TaskbarList, 0x56fdf344,0xfd6d,0x11d0,0x95,0x8a,0x00,0x60,0x97,0xc9,0xa0,0x90);
DEFINE_GUID(GUID_TFCAT_TIP_KEYBOARD, 0x34745c63,0xb2f0,0x4784,0x8b,0x67,0x5e,0x12,0xc8,0x70,0x1a,0x31);
DEFINE_GUID(GUID_TFCAT_TIP_SPEECH, 0xB5A73CD1,0x8355,0x426B,0xA1,0x61,0x25,0x98,0x08,0xF2,0x6B,0x14);
DEFINE_GUID(GUID_TFCAT_TIP_HANDWRITING, 0x246ecb87,0xc2f2,0x4abe,0x90,0x5b,0xc8,0xb3,0x8a,0xdd,0x2c,0x43);
@ -51,6 +50,4 @@ DEFINE_GUID(CLSID_DsObjectPicker, 0x17d6ccd8, 0x3b7b, 0x11d2, 0x00b9, 0xe0,0x00,
DEFINE_GUID(CLSID_StdPicture, 0x0BE35204, 0x8F91, 0x11CE, 0x9D,0xE3, 0x00,0xAA,0x00,0x4B,0xB8,0x51);
DEFINE_GUID(CLSID_StdFont, 0x0BE35203, 0x8F91, 0x11CE, 0x9D,0xE3, 0x00,0xAA,0x00,0x4B,0xB8,0x51);
DEFINE_GUID(CLSID_ShellItem, 0x2fe352ea, 0xfd1f, 0x11d2, 0xb1, 0xf4, 0x00, 0xc0, 0x4f, 0x8e, 0xeb, 0x3e);
DEFINE_GUID(SID_VariantConversion, 0x1f101481,0xbccd,0x11d0,0x93,0x36,0x00,0xa0,0xc9,0xd,0xca,0xa9);