Thread: [pygccxml-commit] SF.net SVN: pygccxml:[1468] gccxml_bin/v09/win32
Brought to you by:
mbaas,
roman_yakovenko
From: <rom...@us...> - 2008-12-16 08:51:42
|
Revision: 1468 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1468&view=rev Author: roman_yakovenko Date: 2008-12-16 08:51:37 +0000 (Tue, 16 Dec 2008) Log Message: ----------- update gccxml for windows ( built with msvc 7.1 ) Modified Paths: -------------- gccxml_bin/v09/win32/bin/gccxml.exe gccxml_bin/v09/win32/bin/gccxml_cc1plus.exe gccxml_bin/v09/win32/bin/gccxml_vcconfig.exe gccxml_bin/v09/win32/share/gccxml-0.9/GCC/find_flags gccxml_bin/v09/win32/share/gccxml-0.9/gccxml_config gccxml_bin/v09/win32/share/gccxml-0.9/gccxml_find_flags gccxml_bin/v09/win32/share/man/man1/gccxml.1 Added Paths: ----------- gccxml_bin/v09/win32/share/gccxml-0.9/GCC/3.4/bits/ gccxml_bin/v09/win32/share/gccxml-0.9/GCC/3.4/bits/gthr-default.h gccxml_bin/v09/win32/share/gccxml-0.9/GCC/4.3/ gccxml_bin/v09/win32/share/gccxml-0.9/GCC/4.3/gccxml_builtins.h gccxml_bin/v09/win32/share/gccxml-0.9/Sun/ gccxml_bin/v09/win32/share/gccxml-0.9/Sun/5.8/ gccxml_bin/v09/win32/share/gccxml-0.9/Sun/5.8/adaptation.patch gccxml_bin/v09/win32/share/gccxml-0.9/Sun/README gccxml_bin/v09/win32/share/gccxml-0.9/Sun/adapt_headers.sh gccxml_bin/v09/win32/share/gccxml-0.9/Sun/find_flags gccxml_bin/v09/win32/share/gccxml-0.9/Vc8/ gccxml_bin/v09/win32/share/gccxml-0.9/Vc8/Include/ gccxml_bin/v09/win32/share/gccxml-0.9/Vc8/Include/algorithm gccxml_bin/v09/win32/share/gccxml-0.9/Vc8/Include/comdef.h gccxml_bin/v09/win32/share/gccxml-0.9/Vc8/Include/comip.h gccxml_bin/v09/win32/share/gccxml-0.9/Vc8/Include/comutil.h gccxml_bin/v09/win32/share/gccxml-0.9/Vc8/Include/crtdbg.h gccxml_bin/v09/win32/share/gccxml-0.9/Vc8/Include/crtdefs.h gccxml_bin/v09/win32/share/gccxml-0.9/Vc8/Include/deque gccxml_bin/v09/win32/share/gccxml-0.9/Vc8/Include/eh.h gccxml_bin/v09/win32/share/gccxml-0.9/Vc8/Include/functional gccxml_bin/v09/win32/share/gccxml-0.9/Vc8/Include/iosfwd gccxml_bin/v09/win32/share/gccxml-0.9/Vc8/Include/iostream gccxml_bin/v09/win32/share/gccxml-0.9/Vc8/Include/iso646.h gccxml_bin/v09/win32/share/gccxml-0.9/Vc8/Include/iterator gccxml_bin/v09/win32/share/gccxml-0.9/Vc8/Include/limits gccxml_bin/v09/win32/share/gccxml-0.9/Vc8/Include/list gccxml_bin/v09/win32/share/gccxml-0.9/Vc8/Include/math.h gccxml_bin/v09/win32/share/gccxml-0.9/Vc8/Include/memory gccxml_bin/v09/win32/share/gccxml-0.9/Vc8/Include/process.h gccxml_bin/v09/win32/share/gccxml-0.9/Vc8/Include/setjmp.h gccxml_bin/v09/win32/share/gccxml-0.9/Vc8/Include/signal.h gccxml_bin/v09/win32/share/gccxml-0.9/Vc8/Include/typeinfo gccxml_bin/v09/win32/share/gccxml-0.9/Vc8/Include/vector gccxml_bin/v09/win32/share/gccxml-0.9/Vc8/Include/xdebug gccxml_bin/v09/win32/share/gccxml-0.9/Vc8/Include/xhash gccxml_bin/v09/win32/share/gccxml-0.9/Vc8/Include/xlocale gccxml_bin/v09/win32/share/gccxml-0.9/Vc8/Include/xstddef gccxml_bin/v09/win32/share/gccxml-0.9/Vc8/Include/xutility gccxml_bin/v09/win32/share/gccxml-0.9/Vc8/Include/yvals.h gccxml_bin/v09/win32/share/gccxml-0.9/Vc8/PlatformSDK/ gccxml_bin/v09/win32/share/gccxml-0.9/Vc8/PlatformSDK/OAIdl.h gccxml_bin/v09/win32/share/gccxml-0.9/Vc8/PlatformSDK/PropIdl.h gccxml_bin/v09/win32/share/gccxml-0.9/Vc8/PlatformSDK/WinNT.h gccxml_bin/v09/win32/share/gccxml-0.9/VcInstall/vc9Include.patch gccxml_bin/v09/win32/share/gccxml-0.9/VcInstall/vc9PlatformSDK.patch Modified: gccxml_bin/v09/win32/bin/gccxml.exe =================================================================== (Binary files differ) Modified: gccxml_bin/v09/win32/bin/gccxml_cc1plus.exe =================================================================== (Binary files differ) Modified: gccxml_bin/v09/win32/bin/gccxml_vcconfig.exe =================================================================== (Binary files differ) Added: gccxml_bin/v09/win32/share/gccxml-0.9/GCC/3.4/bits/gthr-default.h =================================================================== --- gccxml_bin/v09/win32/share/gccxml-0.9/GCC/3.4/bits/gthr-default.h (rev 0) +++ gccxml_bin/v09/win32/share/gccxml-0.9/GCC/3.4/bits/gthr-default.h 2008-12-16 08:51:37 UTC (rev 1468) @@ -0,0 +1,664 @@ +/* Threads compatibility routines for libgcc2 and libobjc. */ +/* Compile this one with gcc. */ +/* Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003 + Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ + +/* As a special exception, if you link this library with other files, + some of which are compiled with GCC, to produce an executable, + this library does not by itself cause the resulting executable + to be covered by the GNU General Public License. + This exception does not however invalidate any other reasons why + the executable file might be covered by the GNU General Public License. */ + +#ifndef _GLIBCXX_GCC_GTHR_POSIX_H +#define _GLIBCXX_GCC_GTHR_POSIX_H + +/* POSIX threads specific definitions. + Easy, since the interface is just one-to-one mapping. */ + +#define __GTHREADS 1 + +/* Some implementations of <pthread.h> require this to be defined. */ +#if !defined(_REENTRANT) && defined(__osf__) +#define _REENTRANT 1 +#endif + +#include <pthread.h> +#include <unistd.h> + +typedef pthread_key_t __gthread_key_t; +typedef pthread_once_t __gthread_once_t; +typedef pthread_mutex_t __gthread_mutex_t; +typedef pthread_mutex_t __gthread_recursive_mutex_t; + +#define __GTHREAD_MUTEX_INIT PTHREAD_MUTEX_INITIALIZER +#define __GTHREAD_ONCE_INIT PTHREAD_ONCE_INIT +#if defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER) +#define __GTHREAD_RECURSIVE_MUTEX_INIT PTHREAD_RECURSIVE_MUTEX_INITIALIZER +#elif defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP) +#define __GTHREAD_RECURSIVE_MUTEX_INIT PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP +#else +#define __GTHREAD_RECURSIVE_MUTEX_INIT_FUNCTION __gthread_recursive_mutex_init_function +#endif + +#if __GXX_WEAK__ && _GLIBCXX_GTHREAD_USE_WEAK && defined __GNUC_RH_RELEASE__ \ + && ((__GNUC__ == 3 && __GNUC_MINOR__ == 4 && (__GNUC_PATCHLEVEL__ > 4 || (__GNUC_PATCHLEVEL__ == 4 && __GNUC_RH_RELEASE__ > 2))) \ + || (__GNUC__ == 4 && __GNUC_MINOR__ == 0 && (__GNUC_PATCHLEVEL__ > 2 || (__GNUC_PATCHLEVEL__ == 2 && __GNUC_RH_RELEASE__ > 6)))) \ + && ! defined __attribute__ +# define __gthrw(name) \ + extern __typeof(name) __gthrw_ ## name + + +__gthrw(pthread_once); +__gthrw(pthread_key_create); +__gthrw(pthread_key_delete); +__gthrw(pthread_getspecific); +__gthrw(pthread_setspecific); +__gthrw(pthread_create); + +__gthrw(pthread_mutex_lock); +__gthrw(pthread_mutex_trylock); +__gthrw(pthread_mutex_unlock); +__gthrw(pthread_mutexattr_init); +__gthrw(pthread_mutexattr_settype); +__gthrw(pthread_mutexattr_destroy); + +__gthrw(pthread_mutex_init); + +# if defined(_LIBOBJC) || defined(_LIBOBJC_WEAK) +/* Objective-C. */ +__gthrw(pthread_cond_broadcast); +__gthrw(pthread_cond_destroy); +__gthrw(pthread_cond_init); +__gthrw(pthread_cond_signal); +__gthrw(pthread_cond_wait); +__gthrw(pthread_exit); +__gthrw(pthread_mutex_destroy); +__gthrw(pthread_self); +/* These really should be protected by _POSIX_PRIORITY_SCHEDULING, but + we use them inside a _POSIX_THREAD_PRIORITY_SCHEDULING block. */ +# ifdef _POSIX_THREAD_PRIORITY_SCHEDULING +__gthrw(sched_get_priority_max); +__gthrw(sched_get_priority_min); +# endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */ +__gthrw(sched_yield); +__gthrw(pthread_attr_destroy); +__gthrw(pthread_attr_init); +__gthrw(pthread_attr_setdetachstate); +# ifdef _POSIX_THREAD_PRIORITY_SCHEDULING +__gthrw(pthread_getschedparam); +__gthrw(pthread_setschedparam); +# endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */ +# endif /* _LIBOBJC || _LIBOBJC_WEAK */ +#else +# if __GXX_WEAK__ && _GLIBCXX_GTHREAD_USE_WEAK +#pragma weak pthread_once +#pragma weak pthread_key_create +#pragma weak pthread_key_delete +#pragma weak pthread_getspecific +#pragma weak pthread_setspecific +#pragma weak pthread_create + +#pragma weak pthread_mutex_lock +#pragma weak pthread_mutex_trylock +#pragma weak pthread_mutex_unlock +#pragma weak pthread_mutexattr_init +#pragma weak pthread_mutexattr_settype +#pragma weak pthread_mutexattr_destroy + +#pragma weak pthread_mutex_init + +#if defined(_LIBOBJC) || defined(_LIBOBJC_WEAK) +/* Objective-C. */ +#pragma weak pthread_cond_broadcast +#pragma weak pthread_cond_destroy +#pragma weak pthread_cond_init +#pragma weak pthread_cond_signal +#pragma weak pthread_cond_wait +#pragma weak pthread_exit +#pragma weak pthread_mutex_destroy +#pragma weak pthread_self +/* These really should be protected by _POSIX_PRIORITY_SCHEDULING, but + we use them inside a _POSIX_THREAD_PRIORITY_SCHEDULING block. */ +#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING +#pragma weak sched_get_priority_max +#pragma weak sched_get_priority_min +#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */ +#pragma weak sched_yield +#pragma weak pthread_attr_destroy +#pragma weak pthread_attr_init +#pragma weak pthread_attr_setdetachstate +#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING +#pragma weak pthread_getschedparam +#pragma weak pthread_setschedparam +#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */ +#endif /* _LIBOBJC || _LIBOBJC_WEAK */ +#endif /* __GXX_WEAK__ && _GLIBCXX_GTHREAD_USE_WEAK */ + +#define __gthrw_pthread_once pthread_once +#define __gthrw_pthread_key_create pthread_key_create +#define __gthrw_pthread_key_delete pthread_key_delete +#define __gthrw_pthread_getspecific pthread_getspecific +#define __gthrw_pthread_setspecific pthread_setspecific +#define __gthrw_pthread_create pthread_create + +#define __gthrw_pthread_mutex_lock pthread_mutex_lock +#define __gthrw_pthread_mutex_trylock pthread_mutex_trylock +#define __gthrw_pthread_mutex_unlock pthread_mutex_unlock +#define __gthrw_pthread_mutexattr_init pthread_mutexattr_init +#define __gthrw_pthread_mutexattr_settype pthread_mutexattr_settype +#define __gthrw_pthread_mutexattr_destroy pthread_mutexattr_destroy + +#define __gthrw_pthread_mutex_init pthread_mutex_init + +#if defined(_LIBOBJC) || defined(_LIBOBJC_WEAK) +/* Objective-C. */ +#define __gthrw_pthread_cond_broadcast pthread_cond_broadcast +#define __gthrw_pthread_cond_destroy pthread_cond_destroy +#define __gthrw_pthread_cond_init pthread_cond_init +#define __gthrw_pthread_cond_signal pthread_cond_signal +#define __gthrw_pthread_cond_wait pthread_cond_wait +#define __gthrw_pthread_exit pthread_exit +#define __gthrw_pthread_mutex_destroy pthread_mutex_destroy +#define __gthrw_pthread_self pthread_self +/* These really should be protected by _POSIX_PRIORITY_SCHEDULING, but + we use them inside a _POSIX_THREAD_PRIORITY_SCHEDULING block. */ +#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING +#define __gthrw_sched_get_priority_max sched_get_priority_max +#define __gthrw_sched_get_priority_min sched_get_priority_min +#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */ +#define __gthrw_sched_yield sched_yield +#define __gthrw_pthread_attr_destroy pthread_attr_destroy +#define __gthrw_pthread_attr_init pthread_attr_init +#define __gthrw_pthread_attr_setdetachstate pthread_attr_setdetachstate +#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING +#define __gthrw_pthread_getschedparam pthread_getschedparam +#define __gthrw_pthread_setschedparam pthread_setschedparam +#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */ +#endif /* _LIBOBJC || _LIBOBJC_WEAK */ +#endif + + +#if __GXX_WEAK__ && _GLIBCXX_GTHREAD_USE_WEAK + +static inline int +__gthread_active_p (void) +{ + static void *const __gthread_active_ptr = (void *) &__gthrw_pthread_create; + return __gthread_active_ptr != 0; +} + +#else /* not __GXX_WEAK__ */ + +static inline int +__gthread_active_p (void) +{ + return 1; +} + +#endif /* __GXX_WEAK__ */ + +#ifdef _LIBOBJC + +/* This is the config.h file in libobjc/ */ +#include <config.h> + +#ifdef HAVE_SCHED_H +# include <sched.h> +#endif + +/* Key structure for maintaining thread specific storage */ +static pthread_key_t _objc_thread_storage; +static pthread_attr_t _objc_thread_attribs; + +/* Thread local storage for a single thread */ +static void *thread_local_storage = NULL; + +/* Backend initialization functions */ + +/* Initialize the threads subsystem. */ +static inline int +__gthread_objc_init_thread_system (void) +{ + if (__gthread_active_p ()) + { + /* Initialize the thread storage key */ + if (__gthrw_pthread_key_create (&_objc_thread_storage, NULL) == 0) + { + /* The normal default detach state for threads is + * PTHREAD_CREATE_JOINABLE which causes threads to not die + * when you think they should. */ + if (__gthrw_pthread_attr_init (&_objc_thread_attribs) == 0 + && __gthrw_pthread_attr_setdetachstate (&_objc_thread_attribs, + PTHREAD_CREATE_DETACHED) == 0) + return 0; + } + } + + return -1; +} + +/* Close the threads subsystem. */ +static inline int +__gthread_objc_close_thread_system (void) +{ + if (__gthread_active_p () + && __gthrw_pthread_key_delete (_objc_thread_storage) == 0 + && __gthrw_pthread_attr_destroy (&_objc_thread_attribs) == 0) + return 0; + + return -1; +} + +/* Backend thread functions */ + +/* Create a new thread of execution. */ +static inline objc_thread_t +__gthread_objc_thread_detach (void (*func)(void *), void *arg) +{ + objc_thread_t thread_id; + pthread_t new_thread_handle; + + if (!__gthread_active_p ()) + return NULL; + + if (!(__gthrw_pthread_create (&new_thread_handle, NULL, (void *) func, arg))) + thread_id = (objc_thread_t) new_thread_handle; + else + thread_id = NULL; + + return thread_id; +} + +/* Set the current thread's priority. */ +static inline int +__gthread_objc_thread_set_priority (int priority) +{ + if (!__gthread_active_p ()) + return -1; + else + { +#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING + pthread_t thread_id = __gthrw_pthread_self (); + int policy; + struct sched_param params; + int priority_min, priority_max; + + if (__gthrw_pthread_getschedparam (thread_id, &policy, ¶ms) == 0) + { + if ((priority_max = __gthrw_sched_get_priority_max (policy)) == -1) + return -1; + + if ((priority_min = __gthrw_sched_get_priority_min (policy)) == -1) + return -1; + + if (priority > priority_max) + priority = priority_max; + else if (priority < priority_min) + priority = priority_min; + params.sched_priority = priority; + + /* + * The solaris 7 and several other man pages incorrectly state that + * this should be a pointer to policy but pthread.h is universally + * at odds with this. + */ + if (__gthrw_pthread_setschedparam (thread_id, policy, ¶ms) == 0) + return 0; + } +#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */ + return -1; + } +} + +/* Return the current thread's priority. */ +static inline int +__gthread_objc_thread_get_priority (void) +{ +#ifdef _POSIX_THREAD_PRIORITY_SCHEDULING + if (__gthread_active_p ()) + { + int policy; + struct sched_param params; + + if (__gthrw_pthread_getschedparam (__gthrw_pthread_self (), &policy, ¶ms) == 0) + return params.sched_priority; + else + return -1; + } + else +#endif /* _POSIX_THREAD_PRIORITY_SCHEDULING */ + return OBJC_THREAD_INTERACTIVE_PRIORITY; +} + +/* Yield our process time to another thread. */ +static inline void +__gthread_objc_thread_yield (void) +{ + if (__gthread_active_p ()) + __gthrw_sched_yield (); +} + +/* Terminate the current thread. */ +static inline int +__gthread_objc_thread_exit (void) +{ + if (__gthread_active_p ()) + /* exit the thread */ + __gthrw_pthread_exit (&__objc_thread_exit_status); + + /* Failed if we reached here */ + return -1; +} + +/* Returns an integer value which uniquely describes a thread. */ +static inline objc_thread_t +__gthread_objc_thread_id (void) +{ + if (__gthread_active_p ()) + return (objc_thread_t) __gthrw_pthread_self (); + else + return (objc_thread_t) 1; +} + +/* Sets the thread's local storage pointer. */ +static inline int +__gthread_objc_thread_set_data (void *value) +{ + if (__gthread_active_p ()) + return __gthrw_pthread_setspecific (_objc_thread_storage, value); + else + { + thread_local_storage = value; + return 0; + } +} + +/* Returns the thread's local storage pointer. */ +static inline void * +__gthread_objc_thread_get_data (void) +{ + if (__gthread_active_p ()) + return __gthrw_pthread_getspecific (_objc_thread_storage); + else + return thread_local_storage; +} + +/* Backend mutex functions */ + +/* Allocate a mutex. */ +static inline int +__gthread_objc_mutex_allocate (objc_mutex_t mutex) +{ + if (__gthread_active_p ()) + { + mutex->backend = objc_malloc (sizeof (pthread_mutex_t)); + + if (__gthrw_pthread_mutex_init ((pthread_mutex_t *) mutex->backend, NULL)) + { + objc_free (mutex->backend); + mutex->backend = NULL; + return -1; + } + } + + return 0; +} + +/* Deallocate a mutex. */ +static inline int +__gthread_objc_mutex_deallocate (objc_mutex_t mutex) +{ + if (__gthread_active_p ()) + { + int count; + + /* + * Posix Threads specifically require that the thread be unlocked + * for __gthrw_pthread_mutex_destroy to work. + */ + + do + { + count = __gthrw_pthread_mutex_unlock ((pthread_mutex_t *) mutex->backend); + if (count < 0) + return -1; + } + while (count); + + if (__gthrw_pthread_mutex_destroy ((pthread_mutex_t *) mutex->backend)) + return -1; + + objc_free (mutex->backend); + mutex->backend = NULL; + } + return 0; +} + +/* Grab a lock on a mutex. */ +static inline int +__gthread_objc_mutex_lock (objc_mutex_t mutex) +{ + if (__gthread_active_p () + && __gthrw_pthread_mutex_lock ((pthread_mutex_t *) mutex->backend) != 0) + { + return -1; + } + + return 0; +} + +/* Try to grab a lock on a mutex. */ +static inline int +__gthread_objc_mutex_trylock (objc_mutex_t mutex) +{ + if (__gthread_active_p () + && __gthrw_pthread_mutex_trylock ((pthread_mutex_t *) mutex->backend) != 0) + { + return -1; + } + + return 0; +} + +/* Unlock the mutex */ +static inline int +__gthread_objc_mutex_unlock (objc_mutex_t mutex) +{ + if (__gthread_active_p () + && __gthrw_pthread_mutex_unlock ((pthread_mutex_t *) mutex->backend) != 0) + { + return -1; + } + + return 0; +} + +/* Backend condition mutex functions */ + +/* Allocate a condition. */ +static inline int +__gthread_objc_condition_allocate (objc_condition_t condition) +{ + if (__gthread_active_p ()) + { + condition->backend = objc_malloc (sizeof (pthread_cond_t)); + + if (__gthrw_pthread_cond_init ((pthread_cond_t *) condition->backend, NULL)) + { + objc_free (condition->backend); + condition->backend = NULL; + return -1; + } + } + + return 0; +} + +/* Deallocate a condition. */ +static inline int +__gthread_objc_condition_deallocate (objc_condition_t condition) +{ + if (__gthread_active_p ()) + { + if (__gthrw_pthread_cond_destroy ((pthread_cond_t *) condition->backend)) + return -1; + + objc_free (condition->backend); + condition->backend = NULL; + } + return 0; +} + +/* Wait on the condition */ +static inline int +__gthread_objc_condition_wait (objc_condition_t condition, objc_mutex_t mutex) +{ + if (__gthread_active_p ()) + return __gthrw_pthread_cond_wait ((pthread_cond_t *) condition->backend, + (pthread_mutex_t *) mutex->backend); + else + return 0; +} + +/* Wake up all threads waiting on this condition. */ +static inline int +__gthread_objc_condition_broadcast (objc_condition_t condition) +{ + if (__gthread_active_p ()) + return __gthrw_pthread_cond_broadcast ((pthread_cond_t *) condition->backend); + else + return 0; +} + +/* Wake up one thread waiting on this condition. */ +static inline int +__gthread_objc_condition_signal (objc_condition_t condition) +{ + if (__gthread_active_p ()) + return __gthrw_pthread_cond_signal ((pthread_cond_t *) condition->backend); + else + return 0; +} + +#else /* _LIBOBJC */ + +static inline int +__gthread_once (__gthread_once_t *once, void (*func) (void)) +{ + if (__gthread_active_p ()) + return __gthrw_pthread_once (once, func); + else + return -1; +} + +static inline int +__gthread_key_create (__gthread_key_t *key, void (*dtor) (void *)) +{ + return __gthrw_pthread_key_create (key, dtor); +} + +static inline int +__gthread_key_delete (__gthread_key_t key) +{ + return __gthrw_pthread_key_delete (key); +} + +static inline void * +__gthread_getspecific (__gthread_key_t key) +{ + return __gthrw_pthread_getspecific (key); +} + +static inline int +__gthread_setspecific (__gthread_key_t key, const void *ptr) +{ + return __gthrw_pthread_setspecific (key, ptr); +} + +static inline int +__gthread_mutex_lock (__gthread_mutex_t *mutex) +{ + if (__gthread_active_p ()) + return __gthrw_pthread_mutex_lock (mutex); + else + return 0; +} + +static inline int +__gthread_mutex_trylock (__gthread_mutex_t *mutex) +{ + if (__gthread_active_p ()) + return __gthrw_pthread_mutex_trylock (mutex); + else + return 0; +} + +static inline int +__gthread_mutex_unlock (__gthread_mutex_t *mutex) +{ + if (__gthread_active_p ()) + return __gthrw_pthread_mutex_unlock (mutex); + else + return 0; +} + +#ifndef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP +static inline int +__gthread_recursive_mutex_init_function (__gthread_recursive_mutex_t *mutex) +{ + if (__gthread_active_p ()) + { + pthread_mutexattr_t attr; + int r; + + r = __gthrw_pthread_mutexattr_init (&attr); + if (!r) + r = __gthrw_pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE); + if (!r) + r = __gthrw_pthread_mutex_init (mutex, &attr); + if (!r) + r = __gthrw_pthread_mutexattr_destroy (&attr); + return r; + } +} +#endif + +static inline int +__gthread_recursive_mutex_lock (__gthread_recursive_mutex_t *mutex) +{ + return __gthread_mutex_lock (mutex); +} + +static inline int +__gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *mutex) +{ + return __gthread_mutex_trylock (mutex); +} + +static inline int +__gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *mutex) +{ + return __gthread_mutex_unlock (mutex); +} + +#endif /* _LIBOBJC */ + +#endif /* ! _GLIBCXX_GCC_GTHR_POSIX_H */ Added: gccxml_bin/v09/win32/share/gccxml-0.9/GCC/4.3/gccxml_builtins.h =================================================================== --- gccxml_bin/v09/win32/share/gccxml-0.9/GCC/4.3/gccxml_builtins.h (rev 0) +++ gccxml_bin/v09/win32/share/gccxml-0.9/GCC/4.3/gccxml_builtins.h 2008-12-16 08:51:37 UTC (rev 1468) @@ -0,0 +1,181 @@ +#define __builtin_apply(x,y,z) ((void*)0) +#define __builtin_nan(x) (0.0) +#define __builtin_nanf(x) (0.0f) +#define __builtin_nanl(x) (0.0l) +#define __builtin_huge_val(x) (0.0) +#define __builtin_huge_valf(x) (0.0f) +#define __builtin_huge_vall(x) (0.0l) +#define __builtin_apply_args(x) ((void*)0) +#define __builtin_types_compatible_p(x,y) 0 +#define __builtin_choose_expr(x,y,z) int +#define __builtin_constant_p(x) 0 +void* __builtin_memchr(void const*, int, unsigned int); +void __builtin_return (void *RESULT); +void * __builtin_return_address (unsigned int LEVEL); +void * __builtin_frame_address (unsigned int LEVEL); +long __builtin_expect (long EXP, long C); +void __builtin_prefetch (const void *ADDR, ...); +double __builtin_inf (void); +float __builtin_inff (void); +long double __builtin_infl (void); +double __builtin_nans (const char *str); +float __builtin_nansf (const char *str); +long double __builtin_nansl (const char *str); +double __builtin_acos(double); +float __builtin_acosf(float); +long double __builtin_acosl(long double); +double __builtin_asin(double); +float __builtin_asinf(float); +long double __builtin_asinl(long double); +double __builtin_atan(double); +double __builtin_atan2(double, double); +float __builtin_atan2f(float, float); +long double __builtin_atan2l(long double, long double); +float __builtin_atanf(float); +long double __builtin_atanl(long double); +double __builtin_ceil(double); +float __builtin_ceilf(float); +long double __builtin_ceill(long double); +double __builtin_cos(double); +float __builtin_cosf(float); +double __builtin_cosh(double); +float __builtin_coshf(float); +long double __builtin_coshl(long double); +long double __builtin_cosl(long double); +double __builtin_exp(double); +float __builtin_expf(float); +long double __builtin_expl(long double); +double __builtin_fabs(double); +float __builtin_fabsf(float); +long double __builtin_fabsl(long double); +double __builtin_floor(double); +float __builtin_floorf(float); +long double __builtin_floorl(long double); +float __builtin_fmodf(float, float); +long double __builtin_fmodl(long double, long double); +double __builtin_frexp(double, int*); +float __builtin_frexpf(float, int*); +long double __builtin_frexpl(long double, int*); +double __builtin_ldexp(double, int); +float __builtin_ldexpf(float, int); +long double __builtin_ldexpl(long double, int); +double __builtin_log(double); +double __builtin_log10(double); +float __builtin_log10f(float); +long double __builtin_log10l(long double); +float __builtin_logf(float); +long double __builtin_logl(long double); +float __builtin_modff(float, float*); +long double __builtin_modfl(long double, long double*); +float __builtin_powf(float, float); +long double __builtin_powl(long double, long double); +double __builtin_powi(double, int); +float __builtin_powif(float, int); +long double __builtin_powil(long double, int); +double __builtin_sin(double); +float __builtin_sinf(float); +double __builtin_sinh(double); +float __builtin_sinhf(float); +long double __builtin_sinhl(long double); +long double __builtin_sinl(long double); +double __builtin_sqrt(double); +float __builtin_sqrtf(float); +long double __builtin_sqrtl(long double); +double __builtin_tan(double); +float __builtin_tanf(float); +double __builtin_tanh(double); +float __builtin_tanhf(float); +long double __builtin_tanhl(long double); +long double __builtin_tanl(long double); +float __builtin_cabsf(float __complex__); +double __builtin_cabs(double __complex__); +long double __builtin_cabsl(long double __complex__); +float __builtin_cargf(float __complex__); +double __builtin_carg(double __complex__); +long double __builtin_cargl(long double __complex__); +int __builtin_ctz(int); +int __builtin_ctzl(long); +int __builtin_ctzll(long long); +int __builtin_popcount(int); +int __builtin_popcountl(long); +int __builtin_popcountll(long long); +float __complex__ __builtin_ccosf(float __complex__); +double __complex__ __builtin_ccos(double __complex__); +long double __complex__ __builtin_ccosl(long double __complex__); +float __complex__ __builtin_ccoshf(float __complex__); +double __complex__ __builtin_ccosh(double __complex__); +long double __complex__ __builtin_ccoshl(long double __complex__); +float __complex__ __builtin_cexpf(float __complex__); +double __complex__ __builtin_cexp(double __complex__); +long double __complex__ __builtin_cexpl(long double __complex__); +float __complex__ __builtin_clogf(float __complex__); +double __complex__ __builtin_clog(double __complex__); +long double __complex__ __builtin_clogl(long double __complex__); +float __complex__ __builtin_csinf(float __complex__); +double __complex__ __builtin_csin(double __complex__); +long double __complex__ __builtin_csinl(long double __complex__); +float __complex__ __builtin_csinhf(float __complex__); +double __complex__ __builtin_csinh(double __complex__); +long double __complex__ __builtin_csinhl(long double __complex__); +float __complex__ __builtin_csqrtf(float __complex__); +double __complex__ __builtin_csqrt(double __complex__); +long double __complex__ __builtin_csqrtl(long double __complex__); +float __complex__ __builtin_ctanf(float __complex__); +double __complex__ __builtin_ctan(double __complex__); +long double __complex__ __builtin_ctanl(long double __complex__); +float __complex__ __builtin_ctanhf(float __complex__); +double __complex__ __builtin_ctanh(double __complex__); +long double __complex__ __builtin_ctanhl(long double __complex__); +float __complex__ __builtin_cpowf(float __complex__, float __complex__); +double __complex__ __builtin_cpow(double __complex__, double __complex__); +long double __complex__ __builtin_cpowl(long double __complex__, long double __complex__); + +/* The GCC 4.3 parser hard-codes handling of these, so they do not + have real signatures. */ +bool __builtin_isfinite(...); +bool __builtin_isinf(...); +bool __builtin_isnan(...); +bool __builtin_isnormal(...); +bool __builtin_isgreater(...); +bool __builtin_isgreaterequal(...); +bool __builtin_isless(...); +bool __builtin_islessequal(...); +bool __builtin_islessgreater(...); +bool __builtin_isunordered(...); + +/* + +GCC 4.3 has the following additional builtin compile-time constant +expressions: + + __builtin_va_arg ( assignment-expression , type-id ) + __builtin_offsetof ( type-id , offsetof-expression ) + + __has_nothrow_assign(T) + __has_nothrow_constructor(T) + __has_nothrow_copy(T) + __has_trivial_assign(T) + __has_trivial_constructor(T) + __has_trivial_copy(T) + __has_trivial_destructor(T) + __has_virtual_destructor(T) + __is_abstract(T) + __is_base_of(Tbase,Tderived) + __is_class(T) + __is_convertible_to(Tfrom,Tto) + __is_empty(T) + __is_enum(T) + __is_pod(T) + __is_polymorphic(T) + __is_union(T) + +In order to really support these we would have to update GCC-XML's +internal parser to be GCC 4.3. Since this has not yet been done we +get most of the way by defining some of these as macros with fake +answers. It is enough to get through GCC 4.3's C++98 standard +library. +*/ + +#define __is_pod(x) false +#define __is_empty(x) false +#define __has_trivial_destructor(x) false Modified: gccxml_bin/v09/win32/share/gccxml-0.9/GCC/find_flags =================================================================== --- gccxml_bin/v09/win32/share/gccxml-0.9/GCC/find_flags 2008-12-15 20:53:49 UTC (rev 1467) +++ gccxml_bin/v09/win32/share/gccxml-0.9/GCC/find_flags 2008-12-16 08:51:37 UTC (rev 1468) @@ -4,8 +4,8 @@ # Program: GCC-XML # Module: $RCSfile: find_flags,v $ # Language: C++ -# Date: $Date: 2007/11/02 19:03:40 $ -# Version: $Revision: 1.20 $ +# Date: $Date: 2008-08-07 15:36:08 $ +# Version: $Revision: 1.23 $ # # Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. # See Copyright.txt for details. @@ -41,9 +41,16 @@ INCLUDES=` echo "" | ${CXX} -v -x c++ -E ${CXXFLAGS} - 2>&1 | awk '/^[^ \/].*$/ { if (f) { printf("\n"); exit } } - /^[ ]*\/[^ ]*$/ { if (f) { printf("-I%s ",$0) } } - /\#include <\.\.\..*$/ {f=1} ' - | - sed 's/^-I /-I/;s/ -I / -I/g' + /^[ ]*(\/[^ ]*)( \(.*\))?$/ { + if (f) { + if (match($1,"/Frameworks")) { + printf("-F%s ",$1) + } else { + printf("-isystem%s ",$1) + } + } + } + /\#include <\.\.\..*$/ {f=1} ' - ` # The support headers are located where this script is. @@ -74,6 +81,9 @@ if [ "$MINOR_VERSION" = 96 ]; then INCLUDES="-iwrapper\"$SELFPATH/2.96\" $INCLUDES" fi +elif [ "$MAJOR_VERSION" = 4 -a "$MINOR_VERSION" -ge 3 ]; then + INCLUDES="-iwrapper\"$SELFPATH/4.3\" $INCLUDES" + SPECIAL="-include \"gccxml_builtins.h\"" elif [ "$MAJOR_VERSION" = 4 -a "$MINOR_VERSION" -ge 2 ]; then INCLUDES="-iwrapper\"$SELFPATH/4.2\" $INCLUDES" SPECIAL="-include \"gccxml_builtins.h\"" Added: gccxml_bin/v09/win32/share/gccxml-0.9/Sun/5.8/adaptation.patch =================================================================== --- gccxml_bin/v09/win32/share/gccxml-0.9/Sun/5.8/adaptation.patch (rev 0) +++ gccxml_bin/v09/win32/share/gccxml-0.9/Sun/5.8/adaptation.patch 2008-12-16 08:51:37 UTC (rev 1468) @@ -0,0 +1,168 @@ +Common subdirectories: ./iso and ../result/iso +diff -r -u ./istream ../result/istream +--- ./istream Fri Nov 16 16:40:47 2007 ++++ ../result/istream Fri Nov 16 15:22:16 2007 +@@ -419,9 +419,11 @@ + const istream_iterator<T,charT,traits,Distance>& x, + const istream_iterator<T,charT,traits,Distance>& y); + #else +- friend inline bool operator== <> ( ++/* SMOSS 29/08/07 inline not allowed in friend declaration */ ++ friend /*inline*/ bool operator== <> ( + const istream_iterator<T,charT,traits,Distance>& x, + const istream_iterator<T,charT,traits,Distance>& y); ++/* END SMOSS 29/08/07 inline not allowed in friend declaration */ + #endif + public: + typedef charT char_type; +diff -r -u ./math.h ../result/math.h +--- ./math.h Fri Nov 16 17:25:29 2007 ++++ ../result/math.h Fri Nov 16 15:22:16 2007 +@@ -313,6 +313,11 @@ + #endif + /* END adopted by C99 */ + ++/* SMOSS 29/08/07 <floatingpoint.h> conflicts with stdlib_iso.h */ ++#ifdef __EXTENSIONS__ ++# undef __EXTENSIONS__ ++#endif //__EXTENSIONS__ ++/* END SMOSS 29/08/07 <floatingpoint.h> conflicts with stdlib_iso.h */ + #if defined(__EXTENSIONS__) || !defined(__cplusplus) + #include <floatingpoint.h> + #endif +@@ -319,6 +324,11 @@ + #endif /* defined(__EXTENSIONS__) || !defined(_XOPEN_SOURCE) */ + #endif /* defined(__EXTENSIONS__) || defined(_XOPEN_SOURCE) || ... */ + ++/* SMOSS 29/08/07 <floatingpoint.h> conflicts with stdlib_iso.h */ ++#ifdef __EXTENSIONS__ ++# define __EXTENSIONS__ ++#endif //__EXTENSIONS__ ++/* END SMOSS 29/08/07 <floatingpoint.h> conflicts with stdlib_iso.h */ + #if defined(__cplusplus) && defined(__GNUC__) + #undef exception + #endif +Common subdirectories: ./rw and ../result/rw +diff -r -u ./streambuf ../result/streambuf +--- ./streambuf Fri Nov 16 16:40:47 2007 ++++ ../result/streambuf Fri Nov 16 15:22:16 2007 +@@ -927,7 +927,10 @@ + * int_type snextc() + * returns the next character + */ +- ++/* SMOSS 29/08/07 Can't use typename in template specializations */ ++#ifdef _TYPENAME ++# define _TYPENAME ++#endif + inline _TYPENAME basic_streambuf<char, char_traits<char> >::int_type + basic_streambuf<char, char_traits<char> >::snextc() + { +@@ -1208,6 +1211,11 @@ + { + return seekpos(sp, which); + } ++#ifdef _TYPENAME ++# define _TYPENAME typename ++# undef _OLD_TYPENAME ++#endif ++/* END SMOSS 29/08/07 Can't use typename in template specializations */ + + /* + * basic_streambuf *pubsetbuf(char_type *, streamsize) +diff -r -u ./string ../result/string +--- ./string Fri Nov 16 16:40:47 2007 ++++ ../result/string Fri Nov 16 15:22:16 2007 +@@ -797,7 +797,9 @@ + // Null string ref + // + #ifndef _RWSTD_NO_STATIC_DEF3 +- static __SUNW_GLOBAL const __null_ref_type __nullref; ++/* SMOSS 29/08/07 Can't resolve #define __SUNW_GLOBAL __global */ ++ static /* __SUNW_GLOBAL */ const __null_ref_type __nullref; ++/* SMOSS 29/08/07 Can't resolve #define __SUNW_GLOBAL __global */ + #endif + + static __string_ref_type * __getNullRep () +Common subdirectories: ./sys and ../result/sys +diff -r -u ./typeinfo ../result/typeinfo +--- ./typeinfo Fri Nov 16 16:40:47 2007 ++++ ../result/typeinfo Fri Nov 16 15:22:16 2007 +@@ -34,7 +34,8 @@ + // Implementation + const void* __data; + type_info(const void*) throw(); +- friend __Cimpl::__type_info_friend; ++ /* SMOSS 29/08/07 Can't resolve */ ++ //friend __Cimpl::__type_info_friend; + }; + + class bad_typeid: public exception { +diff -r -u ./iso/stdlib_iso.h ../result/iso/stdlib_iso.h +--- ./iso/stdlib_iso.h Fri Nov 16 16:40:47 2007 ++++ ../result/iso/stdlib_iso.h Fri Nov 16 15:22:16 2007 +@@ -110,8 +110,10 @@ + extern double atof(const char *); + extern int atoi(const char *); + extern long int atol(const char *); ++/* SMOSS 29/08/07 + extern void *bsearch(const void *, const void *, size_t, size_t, + int (*)(const void *, const void *)); ++*/ + #if __cplusplus >= 199711L + extern "C++" { + void *bsearch(const void *, const void *, size_t, size_t, +@@ -131,7 +133,6 @@ + extern size_t mbstowcs(wchar_t *_RESTRICT_KYWD, const char *_RESTRICT_KYWD, + size_t); + extern int mbtowc(wchar_t *_RESTRICT_KYWD, const char *_RESTRICT_KYWD, size_t); +-extern void qsort(void *, size_t, size_t, int (*)(const void *, const void *)); + #if __cplusplus >= 199711L + extern "C++" { + void qsort(void *, size_t, size_t, int (*)(const void *, const void *)); +diff -r -u ./rw/iterator ../result/rw/iterator +--- ./rw/iterator Fri Nov 16 17:03:59 2007 ++++ ../result/rw/iterator Fri Nov 16 15:22:16 2007 +@@ -426,10 +426,12 @@ + friend inline difference_type (std::operator-) (const self& x, const self& y); + friend inline self (std::operator+) (difference_type n, const self& x); + #else +- friend inline bool operator== <> (const self& x, const self& y); +- friend inline bool operator< <> (const self& x, const self& y); +- friend inline difference_type operator- <> (const self& x, const self& y); +- friend inline self operator+ <> (difference_type n, const self& x); ++/* SMOSS 29/08/07 removing 'inline' from friend declarations */ ++ friend /*inline*/ bool operator== <> (const self& x, const self& y); ++ friend /*inline*/ bool operator< <> (const self& x, const self& y); ++ friend /*inline*/ difference_type operator- <> (const self& x, const self& y); ++ friend /*inline*/ self operator+ <> (difference_type n, const self& x); ++/* END SMOSS 29/08/07 removing 'inline' from friend declarations */ + #endif + protected: + +@@ -581,7 +583,9 @@ + typedef Reference reference; + typedef Pointer pointer; + +- friend inline bool operator== <> (const self& x, const self& y); ++/* SMOSS 29/08/07 removing 'inline' from friend declarations */ ++ friend /*inline*/ bool operator== <> (const self& x, const self& y); ++/* END SMOSS 29/08/07 removing 'inline' from friend declarations */ + + protected: + +diff -r -u ./sys/regset.h ../result/sys/regset.h +--- ./sys/regset.h Fri Nov 16 16:40:47 2007 ++++ ../result/sys/regset.h Fri Nov 16 15:22:16 2007 +@@ -16,7 +16,10 @@ + #pragma ident "@(#)regset.h 1.28 04/09/28 SMI" /* SVr4.0 1.1 */ + + #include <sys/feature_tests.h> +- ++/* SMOSS 29/08/07 */ ++//#include <inttypes.h> ++typedef long long unsigned int uint64_t; ++/* end SMOSS 29/08/08 */ + #if !defined(_ASM) + #include <sys/int_types.h> + #endif Added: gccxml_bin/v09/win32/share/gccxml-0.9/Sun/README =================================================================== --- gccxml_bin/v09/win32/share/gccxml-0.9/Sun/README (rev 0) +++ gccxml_bin/v09/win32/share/gccxml-0.9/Sun/README 2008-12-16 08:51:37 UTC (rev 1468) @@ -0,0 +1,8 @@ +Sun CC support contributed by Pierre-Olivier Gaillard + +This is a small README file regarding gccxml support for Solaris and Sun CC 5.8. + +The Sun CC headers are not suitable for GCC and need to be adapted. The adapted files may not be redistributed freely. This forces you to perform the following operations: + ./adapt_headers.sh + +This will produce corrected header files in the 5.8 directory. Added: gccxml_bin/v09/win32/share/gccxml-0.9/Sun/adapt_headers.sh =================================================================== --- gccxml_bin/v09/win32/share/gccxml-0.9/Sun/adapt_headers.sh (rev 0) +++ gccxml_bin/v09/win32/share/gccxml-0.9/Sun/adapt_headers.sh 2008-12-16 08:51:37 UTC (rev 1468) @@ -0,0 +1,24 @@ +#!/bin/sh + +INCLUDES=/usr/include +CC_INCLUDES=`find_flags | perl -ne '($a) = m|-I([/a-zA-Z0-9_-]+/include/CC)|o ; print "$a\n" if $a'` + +cd 5.8 + +cp $INCLUDES/math.h . +cp $CC_INCLUDES/typeinfo . +cp $CC_INCLUDES/Cstd/istream . +cp $CC_INCLUDES/Cstd/streambuf . +cp $CC_INCLUDES/Cstd/string . + +mkdir -p rw +mkdir -p sys +mkdir -p iso + +cp $CC_INCLUDES/Cstd/rw/iterator rw/iterator +cp $INCLUDES/iso/stdio_iso.h iso +cp $INCLUDES/iso/stdlib_iso.h iso + +cp $INCLUDES/sys/regset.h sys + +patch -p1 < adaptation.patch Added: gccxml_bin/v09/win32/share/gccxml-0.9/Sun/find_flags =================================================================== --- gccxml_bin/v09/win32/share/gccxml-0.9/Sun/find_flags (rev 0) +++ gccxml_bin/v09/win32/share/gccxml-0.9/Sun/find_flags 2008-12-16 08:51:37 UTC (rev 1468) @@ -0,0 +1,69 @@ +#!/bin/sh +#============================================================================= +# +# Program: GCC-XML +# Module: $RCSfile: find_flags,v $ +# Language: C++ +# Date: $Date: 2007-11-28 19:52:06 $ +# Version: $Revision: 1.1 $ +# +# Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. +# See Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even +# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the above copyright notices for more information. +# +#============================================================================= +# Find the CC executable name. +if test "x$1" = "x" ; then + if test "x${CXX}" = "x" ; then + CXX=CC + fi +else + CXX="$1" + shift + CXXFLAGS="$@" +fi + +GCCXML_PID="$$" +cat > "/tmp/gccxml_identify_compiler_args$GCCXML_PID.cc" <<! +#include <> +! + +# Find the macro definition options. +MACROS=`${CXX} /tmp/gccxml_identify_compiler_args$GCCXML_PID.cc -E -xdumpmacros=defs 2>&1 | + awk '{ if ($1 ~ /#define/) printf("-D%s=%s %s %s ",$2,$3,$4,$5) }' + ` +MACROS="-D__cplusplus=199711L -D__STDC__ -D_REENTRANT $MACROS" + +# Find the include path options. +#todo test for truss +INCLUDES=`truss -f -t openat ${CXX} -E /tmp/gccxml_identify_compiler_args$GCCXML_PID.cc 2>&1 | + awk '{if ($3 ~ /\"[A-Za-z0-9_\/.-]+\",/ && $3 !~ /tmp/) + if (tempString!=substr($3,2,length($3)-3)) + { + tempString=substr($3,2,length($3)-3); + printf("-I%s ",tempString) + } + }'` + +#cleanup +rm -rf "/tmp/gccxml_identify_compiler_args$GCCXML_PID.cc" + +# The support headers are located where this script is. +SELFPATH=`echo $0 | sed -n '/\//{s/\/find_flags//;p;}'` +if test "x$SELFPATH" = "x" ; then SELFPATH="." ; fi +SELFPATH=`cd "$SELFPATH" ; pwd` + +# Find CC version +CC_VERSION=`${CXX} -V 2>&1 | awk '{print $4}'` + +# Use hacked headers for CC 5.8 +if [ $CC_VERSION = 5.8 ]; then + INCLUDES="-iwrapper\"$SELFPATH/5.8\" $INCLUDES" +fi + +# Format and print out the options. +OPTIONS="$MACROS $INCLUDES $SPECIAL" +echo $OPTIONS Added: gccxml_bin/v09/win32/share/gccxml-0.9/Vc8/Include/algorithm =================================================================== --- gccxml_bin/v09/win32/share/gccxml-0.9/Vc8/Include/algorithm (rev 0) +++ gccxml_bin/v09/win32/share/gccxml-0.9/Vc8/Include/algorithm 2008-12-16 08:51:37 UTC (rev 1468) @@ -0,0 +1,5711 @@ +// algorithm standard header +#pragma once +#ifndef _ALGORITHM_ +#define _ALGORITHM_ +#ifndef RC_INVOKED +#include <memory> + +#ifdef _MSC_VER +#pragma pack(push,_CRT_PACKING) +#pragma warning(push,3) + #pragma warning(disable: 4244) +#endif /* _MSC_VER */ + +/* ------------------------------------------------------------------------ */ +/* Forward declare these now because they are used as non-dependent names. */ +_STDEXT_BEGIN +template<class _InIt, class _OutIt, class _Ty> +inline _OutIt unchecked_remove_copy(_InIt _First, _InIt _Last, + _OutIt _Dest, const _Ty& _Val); +template<class _InIt, class _OutIt, class _Pr> +inline _OutIt unchecked_remove_copy_if(_InIt _First, _InIt _Last, + _OutIt _Dest, _Pr _Pred); +template<class _InIt1, class _InIt2, class _OutIt> +inline _OutIt unchecked_merge(_InIt1 _First1, _InIt1 _Last1, + _InIt2 _First2, _InIt2 _Last2, _OutIt _Dest); +template<class _InIt1, class _InIt2, class _OutIt, class _Pr> +inline _OutIt unchecked_merge(_InIt1 _First1, _InIt1 _Last1, + _InIt2 _First2, _InIt2 _Last2, _OutIt _Dest, + _Pr _Pred); +template<class _BidIt1, class _BidIt2, class _BidIt3> +inline _BidIt3 _Unchecked_merge_backward(_BidIt1 _First1, _BidIt1 _Last1, + _BidIt2 _First2, _BidIt2 _Last2, + _BidIt3 _Dest); +template<class _BidIt1, class _BidIt2, class _BidIt3, class _Pr> +inline _BidIt3 _Unchecked_merge_backward(_BidIt1 _First1, _BidIt1 _Last1, + _BidIt2 _First2, _BidIt2 _Last2, + _BidIt3 _Dest, _Pr _Pred); +template<class _BidIt, class _OutIt, class _Diff> +inline void _Unchecked_chunked_merge(_BidIt _First, _BidIt _Last, + _OutIt _Dest, _Diff _Chunk, + _Diff _Count); +template<class _BidIt, class _OutIt, class _Diff, class _Pr> +inline void _Unchecked_chunked_merge(_BidIt _First, _BidIt _Last, + _OutIt _Dest, _Diff _Chunk, + _Diff _Count, _Pr _Pred); +_STDEXT_END +/* ------------------------------------------------------------------------ */ + +_STD_BEGIN + + // COMMON SORT PARAMETERS +const int _ISORT_MAX = 32; // maximum size for insertion sort + + // TEMPLATE FUNCTION for_each +template<class _InIt, + class _Fn1> inline + _Fn1 for_each(_InIt _First, _InIt _Last, _Fn1 _Func) + { // perform function for each element + _DEBUG_RANGE(_First, _Last); + _DEBUG_POINTER(_Func); + _CHECKED_BASE_TYPE(_InIt) _ChkFirst(_CHECKED_BASE(_First)); + _CHECKED_BASE_TYPE(_InIt) _ChkLast(_CHECKED_BASE(_Last)); + for (; _ChkFirst != _ChkLast; ++_ChkFirst) + _Func(*_ChkFirst); + return (_Func); + } + + // TEMPLATE FUNCTION find +template<class _InIt, class _Ty> +inline + _InIt _Find(_InIt _First, _InIt _Last, const _Ty& _Val) + { // find first matching _Val + _DEBUG_RANGE(_First, _Last); + for (; _First != _Last; ++_First) + if (*_First == _Val) + break; + return (_First); + } + +inline const char *_Find(const char *_First, const char *_Last, int _Val) + { // find first char that matches _Val + _DEBUG_RANGE(_First, _Last); + _First = (const char *)::memchr(_First, _Val, _Last - _First); + return (_First == 0 ? _Last : _First); + } + +inline const signed char *_Find(const signed char *_First, + const signed char *_Last, int _Val) + { // find first signed char that matches _Val + _DEBUG_RANGE(_First, _Last); + _First = (const signed char *)::memchr(_First, _Val, + _Last - _First); + return (_First == 0 ? _Last : _First); + } + +inline const unsigned char *_Find(const unsigned char *_First, + const unsigned char *_Last, int _Val) + { // find first unsigned char that matches _Val + _DEBUG_RANGE(_First, _Last); + _First = (const unsigned char *)::memchr(_First, _Val, + _Last - _First); + return (_First == 0 ? _Last : _First); + } + +template<class _InIt, class _Ty> +inline + _InIt find(_InIt _First, _InIt _Last, const _Ty& _Val) + { // find first matching _Val + _ASSIGN_FROM_BASE(_First, + _Find(_CHECKED_BASE(_First), _CHECKED_BASE(_Last), _Val)); + return (_First); + } + + // TEMPLATE FUNCTION find_if +template<class _InIt, + class _Pr> inline + _InIt _Find_if(_InIt _First, _InIt _Last, _Pr _Pred) + { // find first satisfying _Pred + _DEBUG_RANGE(_First, _Last); + _DEBUG_POINTER(_Pred); + for (; _First != _Last; ++_First) + if (_Pred(*_First)) + break; + return (_First); + } + +template<class _InIt, + class _Pr> inline + _InIt find_if(_InIt _First, _InIt _Last, _Pr _Pred) + { // find first satisfying _Pred + _ASSIGN_FROM_BASE(_First, + _Find_if(_CHECKED_BASE(_First), _CHECKED_BASE(_Last), _Pred)); + return (_First); + } + + // TEMPLATE FUNCTION adjacent_find +template<class _FwdIt> inline + _FwdIt _Adjacent_find(_FwdIt _First, _FwdIt _Last) + { // find first matching successor + _DEBUG_RANGE(_First, _Last); + for (_FwdIt _Firstb; (_Firstb = _First) != _Last && ++_First != _Last; ) + if (*_Firstb == *_First) + return (_Firstb); + return (_Last); + } + +template<class _FwdIt> inline + _FwdIt adjacent_find(_FwdIt _First, _FwdIt _Last) + { // find first matching successor + _ASSIGN_FROM_BASE(_First, + _Adjacent_find(_CHECKED_BASE(_First), _CHECKED_BASE(_Last))); + return (_First); + } + + // TEMPLATE FUNCTION adjacent_find WITH PRED +template<class _FwdIt, + class _Pr> inline + _FwdIt _Adjacent_find(_FwdIt _First, _FwdIt _Last, _Pr _Pred) + { // find first satisfying _Pred with successor + _DEBUG_RANGE(_First, _Last); + _DEBUG_POINTER(_Pred); + for (_FwdIt _Firstb; (_Firstb = _First) != _Last && ++_First != _Last; ) + if (_Pred(*_Firstb, *_First)) + return (_Firstb); + return (_Last); + } + +template<class _FwdIt, + class _Pr> inline + _FwdIt adjacent_find(_FwdIt _First, _FwdIt _Last, _Pr _Pred) + { // find first satisfying _Pred with successor + _ASSIGN_FROM_BASE(_First, + _Adjacent_find(_CHECKED_BASE(_First), _CHECKED_BASE(_Last), _Pred)); + return (_First); + } + + // TEMPLATE FUNCTION count +template<class _InIt, + class _Ty> inline + typename iterator_traits<_InIt>::difference_type + _Count(_InIt _First, _InIt _Last, const _Ty& _Val) + { // count elements that match _Val + _DEBUG_RANGE(_First, _Last); + typename iterator_traits<_InIt>::difference_type _Cnt = 0; + + for (; _First != _Last; ++_First) + if (*_First == _Val) + ++_Cnt; + return (_Cnt); + } + +template<class _InIt, + class _Ty> inline + typename iterator_traits<_InIt>::difference_type + count(_InIt _First, _InIt _Last, const _Ty& _Val) + { // count elements that match _Val + return _Count(_CHECKED_BASE(_First), _CHECKED_BASE(_Last), _Val); + } + + // TEMPLATE FUNCTION count_if +template<class _InIt, + class _Pr> inline + typename iterator_traits<_InIt>::difference_type + _Count_if(_InIt _First, _InIt _Last, _Pr _Pred) + { // count elements satisfying _Pred + _DEBUG_RANGE(_First, _Last); + _DEBUG_POINTER(_Pred); + typename iterator_traits<_InIt>::difference_type _Count = 0; + + for (; _First != _Last; ++_First) + if (_Pred(*_First)) + ++_Count; + return (_Count); + } + +template<class _InIt, + class _Pr> inline + typename iterator_traits<_InIt>::difference_type + count_if(_InIt _First, _InIt _Last, _Pr _Pred) + { // count elements satisfying _Pred + return _Count_if(_CHECKED_BASE(_First), _CHECKED_BASE(_Last), _Pred); + } + + // TEMPLATE FUNCTION search +template<class _FwdIt1, + class _FwdIt2, + class _Diff1, + class _Diff2> inline + _FwdIt1 _Search(_FwdIt1 _First1, _FwdIt1 _Last1, + _FwdIt2 _First2, _FwdIt2 _Last2, _Diff1 *, _Diff2 *) + { // find first [_First2, _Last2) match + _DEBUG_RANGE(_First1, _Last1); + _DEBUG_RANGE(_First2, _Last2); + _Diff1 _Count1 = 0; + _Distance(_First1, _Last1, _Count1); + _Diff2 _Count2 = 0; + _Distance(_First2, _Last2, _Count2); + + for (; _Count2 <= _Count1; ++_First1, --_Count1) + { // room for match, try it + _FwdIt1 _Mid1 = _First1; + for (_FwdIt2 _Mid2 = _First2; ; ++_Mid1, ++_Mid2) + if (_Mid2 == _Last2) + return (_First1); + else if (!(*_Mid1 == *_Mid2)) + break; + } + return (_Last1); + } + +template<class _FwdIt1, + class _FwdIt2> inline + _FwdIt1 search(_FwdIt1 _First1, _FwdIt1 _Last1, + _FwdIt2 _First2, _FwdIt2 _Last2) + { // find first [_First2, _Last2) match + _ASSIGN_FROM_BASE(_First1, + _Search(_CHECKED_BASE(_First1), _CHECKED_BASE(_Last1), + _CHECKED_BASE(_First2), _CHECKED_BASE(_Last2), + _Dist_type(_First1), _Dist_type(_First2))); + return _First1; + } + + // TEMPLATE FUNCTION search WITH PRED +template<class _FwdIt1, + class _FwdIt2, + class _Diff1, + class _Diff2, + class _Pr> inline + _FwdIt1 _Search(_FwdIt1 _First1, _FwdIt1 _Last1, + _FwdIt2 _First2, _FwdIt2 _Last2, _Pr _Pred, _Diff1 *, _Diff2 *) + { // find first [_First2, _Last2) satisfying _Pred + _DEBUG_RANGE(_First1, _Last1); + _DEBUG_RANGE(_First2, _Last2); + _DEBUG_POINTER(_Pred); + _Diff1 _Count1 = 0; + _Distance(_First1, _Last1, _Count1); + _Diff2 _Count2 = 0; + _Distance(_First2, _Last2, _Count2); + + for (; _Count2 <= _Count1; ++_First1, --_Count1) + { // room for match, try it + _FwdIt1 _Mid1 = _First1; + for (_FwdIt2 _Mid2 = _First2; ; ++_Mid1, ++_Mid2) + if (_Mid2 == _Last2) + return (_First1); + else if (!_Pred(*_Mid1, *_Mid2)) + break; + } + return (_Last1); + } + +template<class _FwdIt1, + class _FwdIt2, + class _Pr> inline + _FwdIt1 search(_FwdIt1 _First1, _FwdIt1 _Last1, + _FwdIt2 _First2, _FwdIt2 _Last2, _Pr _Pred) + { // find first [_First2, _Last2) satisfying _Pred + _ASSIGN_FROM_BASE(_First1, + _Search(_CHECKED_BASE(_First1), _CHECKED_BASE(_Last1), + _CHECKED_BASE(_First2), _CHECKED_BASE(_Last2), _Pred, + _Dist_type(_First1), _Dist_type(_First2))); + return _First1; + } + + // TEMPLATE FUNCTION search_n +template<class _FwdIt1, + class _Diff2, + class _Ty> inline + _FwdIt1 _Search_n(_FwdIt1 _First1, _FwdIt1 _Last1, + _Diff2 _Count, const _Ty& _Val, forward_iterator_tag) + { // find first _Count * _Val match, forward iterators + _DEBUG_RANGE(_First1, _Last1); + _FwdIt1 _Mid1; + + if (_Count == 0) + return (_First1); + + for (;; _First1 = ++_Mid1) + { // look for a long enough sequence + _Diff2 _Count1 = _Count; + + for (; _First1 != _Last1; ++_First1) + if (*_First1 == _Val) + break; // found first match + + for (_Mid1 = _First1;; ) + if (--_Count1 == 0) + return (_First1); // found last match + else if (_Mid1 == _Last1 || !(*++_Mid1 == _Val)) + break; + if (_Mid1 == _Last1) + return (_Last1); + } + } + +template<class _FwdIt1, + class _Diff2, + class _Ty> inline + _FwdIt1 _Search_n(_FwdIt1 _First1, _FwdIt1 _Last1, + _Diff2 _Count, const _Ty& _Val, random_access_iterator_tag) + { // find first _Count * _Val match, random-access iterators + _DEBUG_RANGE(_First1, _Last1); + _FwdIt1 _Mid1; + + if (_Count == 0) + return (_First1); + + for (;; _First1 = ++_Mid1) + { // look for a long enough sequence + _FwdIt1 _Oldfirst1 = _First1; + _Diff2 _Count1 = _Count; + + for (;; _First1 += _Count) + if (_First1 == _Last1) + return (_Last1); // end of sequence + else if (*_First1 == _Val) + break; // found a match + else if (_Last1 - _First1 < _Count) + return (_Last1); // not enough left for a match + + _Mid1 = _First1; + if (_Oldfirst1 != _First1) + for (++_Oldfirst1; _Oldfirst1 != _First1; --_First1, --_Count1) + if (!(_First1[-1] == _Val)) + break; // found beginning of sequence + + for (;;) + if (--_Count1 == 0) + return (_First1); // found last match + else if (_Mid1 == _Last1 || !(*++_Mid1 == _Val)) + break; + if (_Mid1 == _Last1) + return (_Last1); + } + } + +template<class _FwdIt1, + class _Diff2, + class _Ty> inline + _FwdIt1 search_n(_FwdIt1 _First1, _FwdIt1 _Last1, + _Diff2 _Count, const _Ty& _Val) + { // find first _Count * _Val match + _ASSIGN_FROM_BASE(_First1, + _Search_n(_CHECKED_BASE(_First1), _CHECKED_BASE(_Last1), _Count, _Val, + _Iter_cat(_First1))); + return _First1; + } + + // TEMPLATE FUNCTION search_n WITH PRED +template<class _FwdIt1, + class _Diff2, + class _Ty, + class _Pr> inline + _FwdIt1 _Search_n(_FwdIt1 _First1, _FwdIt1 _Last1, + _Diff2 _Count, const _Ty& _Val, _Pr _Pred, forward_iterator_tag) + { // find first _Count * _Val satisfying _Pred, forward iterators + _DEBUG_RANGE(_First1, _Last1); + _DEBUG_POINTER(_Pred); + _FwdIt1 _Mid1; + + if (_Count == 0) + return (_First1); + + for (;; _First1 = ++_Mid1) + { // look for a long enough sequence + _Diff2 _Count1 = _Count; + + for (; _First1 != _Last1; ++_First1) + if (_Pred(*_First1, _Val)) + break; // found first match + + for (_Mid1 = _First1;; ) + if (--_Count1 == 0) + return (_First1); // found last match + else if (_Mid1 == _Last1 || !_Pred(*++_Mid1, _Val)) + break; + if (_Mid1 == _Last1) + return (_Last1); + } + } + +template<class _FwdIt1, + class _Diff2, + class _Ty, + class _Pr> inline + _FwdIt1 _Search_n(_FwdIt1 _First1, _FwdIt1 _Last1, + _Diff2 _Count, const _Ty& _Val, _Pr _Pred, random_access_iterator_tag) + { // find first _Count * _Val satisfying _Pred, random-access iterators + _DEBUG_RANGE(_First1, _Last1); + _DEBUG_POINTER(_Pred); + _FwdIt1 _Mid1; + + if (_Count == 0) + return (_First1); + + for (;; _First1 = ++_Mid1) + { // look for a long enough sequence + _FwdIt1 _Oldfirst1 = _First1; + _Diff2 _Count1 = _Count; + + for (;; _First1 += _Count) + if (_First1 == _Last1) + return (_Last1); // end of sequence + else if (_Pred(*_First1, _Val)) + break; // found a match + else if (_Last1 - _First1 < _Count) + return (_Last1); // not enough left for a match + + if (_Oldfirst1 != _First1) + for (++_Oldfirst1; _Oldfirst1 != _First1; --_First1, --_Count1) + if (!_Pred(_First1[-1], _Val)) + break; // found beginning of sequence + + for (_Mid1 = _First1;; ) + if (--_Count1 == 0) + return (_First1); // found last match + else if (_Mid1 == _Last1 || !_Pred(*++_Mid1, _Val)) + break; + if (_Mid1 == _Last1) + return (_Last1); + } + } + +template<class _FwdIt1, + class _Diff2, + class _Ty, + class _Pr> inline + _FwdIt1 search_n(_FwdIt1 _First1, _FwdIt1 _Last1, + _Diff2 _Count, const _Ty& _Val, _Pr _Pred) + { // find first _Count * _Val satisfying _Pred + _ASSIGN_FROM_BASE(_First1, + _Search_n(_CHECKED_BASE(_First1), _CHECKED_BASE(_Last1), _Count, _Val, _Pred, + _Iter_cat(_First1))); + return _First1; + } + + // TEMPLATE FUNCTION find_end +template<class _FwdIt1, + class _FwdIt2, + class _Diff1, + class _Diff2> inline + _FwdIt1 _Find_end(_FwdIt1 _First1, _FwdIt1 _Last1, + _FwdIt2 _First2, _FwdIt2 _Last2, _Diff1 *, _Diff2 *) + { // find last [_First2, _Last2) match + _DEBUG_RANGE(_First1, _Last1); + _DEBUG_RANGE(_First2, _Last2); + _Diff1 _Count1 = 0; + _Distance(_First1, _Last1, _Count1); + _Diff2 _Count2 = 0; + _Distance(_First2, _Last2, _Count2); + _FwdIt1 _Ans = _Last1; + + if (0 < _Count2) + for (; _Count2 <= _Count1; ++_First1, --_Count1) + { // room for match, try it + _FwdIt1 _Mid1 = _First1; + for (_FwdIt2 _Mid2 = _First2; ; ++_Mid1) + if (!(*_Mid1 == *_Mid2)) + break; + else if (++_Mid2 == _Last2) + { // potential answer, save it + _Ans = _First1; + break; + } + } + return (_Ans); + } + +template<class _FwdIt1, + class _FwdIt2> inline + _FwdIt1 find_end(_FwdIt1 _First1, _FwdIt1 _Last1, + _FwdIt2 _First2, _FwdIt2 _Last2) + { // find last [_First2, _Last2) match + _ASSIGN_FROM_BASE(_First1, + _Find_end(_CHECKED_BASE(_First1), _CHECKED_BASE(_Last1), + _CHECKED_BASE(_First2), _CHECKED_BASE(_Last2), + _Dist_type(_First1), _Dist_type(_First2))); + return _First1; + } + + // TEMPLATE FUNCTION find_end WITH PRED +template<class _FwdIt1, + class _FwdIt2, + class _Diff1, + class _Diff2, + class _Pr> inline + _FwdIt1 _Find_end(_FwdIt1 _First1, _FwdIt1 _Last1, + _FwdIt2 _First2, _FwdIt2 _Last2, _Pr _Pred, _Diff1 *, _Diff2 *) + { // find last [_First2, _Last2) satisfying _Pred + _DEBUG_RANGE(_First1, _Last1); + _DEBUG_RANGE(_First2, _Last2); + _DEBUG_POINTER(_Pred); + _Diff1 _Count1 = 0; + _Distance(_First1, _Last1, _Count1); + _Diff2 _Count2 = 0; + _Distance(_First2, _Last2, _Count2); + _FwdIt1 _Ans = _Last1; + + if (0 < _Coun... [truncated message content] |
From: <rom...@us...> - 2008-12-22 22:59:21
|
Revision: 1484 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1484&view=rev Author: roman_yakovenko Date: 2008-12-22 22:11:51 +0000 (Mon, 22 Dec 2008) Log Message: ----------- update gccxml Modified Paths: -------------- gccxml_bin/v09/win32/bin/gccxml.exe gccxml_bin/v09/win32/bin/gccxml_cc1plus.exe gccxml_bin/v09/win32/bin/gccxml_vcconfig.exe gccxml_bin/v09/win32/share/gccxml-0.9/Intel/find_flags gccxml_bin/v09/win32/share/gccxml-0.9/MIPSpro/find_flags gccxml_bin/v09/win32/share/gccxml-0.9/gccxml_config gccxml_bin/v09/win32/share/man/man1/gccxml.1 Added Paths: ----------- gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/ gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/Include/ gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/Include/CodeAnalysis/ gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/Include/CodeAnalysis/sourceannotations.h gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/Include/algorithm gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/Include/crtdbg.h gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/Include/crtdefs.h gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/Include/crtdefs.h.orig gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/Include/deque gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/Include/eh.h gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/Include/iosfwd gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/Include/iterator gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/Include/limits gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/Include/list gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/Include/locale gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/Include/memory gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/Include/sal.h gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/Include/setjmp.h gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/Include/typeinfo gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/Include/vector gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/Include/vector.orig gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/Include/xhash gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/Include/xhash.orig gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/Include/xlocale gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/Include/xlocmes gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/Include/xlocmon gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/Include/xlocnum gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/Include/xlocnum.orig gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/Include/xloctime gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/Include/xstddef gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/Include/xutility gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/Include/xutility.orig gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/Include/yvals.h gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/Include/yvals.h.orig gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/PlatformSDK/ gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/PlatformSDK/OAIdl.h gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/PlatformSDK/ObjBase.h gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/PlatformSDK/PropIdl.h gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/PlatformSDK/WinNT.h gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/PlatformSDK/ktmtypes.h gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/PlatformSDK/specstrings_strict.h Removed Paths: ------------- gccxml_bin/v09/win32/share/gccxml-0.9/GCC/find_flags gccxml_bin/v09/win32/share/gccxml-0.9/gccxml_find_flags Modified: gccxml_bin/v09/win32/bin/gccxml.exe =================================================================== (Binary files differ) Modified: gccxml_bin/v09/win32/bin/gccxml_cc1plus.exe =================================================================== (Binary files differ) Modified: gccxml_bin/v09/win32/bin/gccxml_vcconfig.exe =================================================================== (Binary files differ) Deleted: gccxml_bin/v09/win32/share/gccxml-0.9/GCC/find_flags =================================================================== --- gccxml_bin/v09/win32/share/gccxml-0.9/GCC/find_flags 2008-12-21 22:28:17 UTC (rev 1483) +++ gccxml_bin/v09/win32/share/gccxml-0.9/GCC/find_flags 2008-12-22 22:11:51 UTC (rev 1484) @@ -1,112 +0,0 @@ -#!/bin/sh -#============================================================================= -# -# Program: GCC-XML -# Module: $RCSfile: find_flags,v $ -# Language: C++ -# Date: $Date: 2008-08-07 15:36:08 $ -# Version: $Revision: 1.23 $ -# -# Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. -# See Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even -# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -# PURPOSE. See the above copyright notices for more information. -# -#============================================================================= - -# Find the GCC executable name. -if test "x$1" = "x" ; then - if test "x${CXX}" = "x" ; then - CXX=gcc - fi -else - CXX="$1" - shift - CXXFLAGS="$@" -fi - -# Find the macro definition options. -MACROS=`echo "" | ${CXX} -x c++ -E -dM ${CXXFLAGS} - 2>/dev/null | - sed -n ' -/^#define / {s/#define \([A-Za-z_][A-Za-z0-9_()]*\) \(.*\)/-D\1='\''\2'\''/;p;} -' | - awk ' -BEGIN { first=1 } -/./ { if(first) { printf("%s", $0); first=0 } else { printf(" %s", $0) } } -'` - -# Find the include path options. -INCLUDES=` - echo "" | ${CXX} -v -x c++ -E ${CXXFLAGS} - 2>&1 | - awk '/^[^ \/].*$/ { if (f) { printf("\n"); exit } } - /^[ ]*(\/[^ ]*)( \(.*\))?$/ { - if (f) { - if (match($1,"/Frameworks")) { - printf("-F%s ",$1) - } else { - printf("-isystem%s ",$1) - } - } - } - /\#include <\.\.\..*$/ {f=1} ' - -` - -# The support headers are located where this script is. -SELFPATH=`echo $0 | sed -n '/\//{s/\/find_flags//;p;}'` -if test "x$SELFPATH" = "x" ; then SELFPATH="." ; fi -SELFPATH=`cd "$SELFPATH" ; pwd` - -# Determine the major version number. -MAJOR_VERSION=` -echo "__GNUC__" | ${CXX} -v -x c++ -E ${CXXFLAGS} - 2>/dev/null | - sed -n '/^[0-9]/{s/[^0-9]//g;p;}'` - -MINOR_VERSION=` -echo "__GNUC_MINOR__" | ${CXX} -v -x c++ -E ${CXXFLAGS} - 2>/dev/null | - sed -n '/^[0-9]/{s/[^0-9]//g;p;}'` - -# hack to handle bad gcc 4.0 on RedHat -if [ "$MAJOR_VERSION" = 4 ]; then - if echo "$INCLUDES" | grep "c++/3\.4" > /dev/null 2>&1; then - MAJOR_VERSION=3 - MINOR_VERSION=4 - fi -fi - -# For GCC versions before 3, some special options are needed. -if [ "$MAJOR_VERSION" -lt 3 ]; then - INCLUDES="-iwrapper\"$SELFPATH/2.95\" $INCLUDES" - if [ "$MINOR_VERSION" = 96 ]; then - INCLUDES="-iwrapper\"$SELFPATH/2.96\" $INCLUDES" - fi -elif [ "$MAJOR_VERSION" = 4 -a "$MINOR_VERSION" -ge 3 ]; then - INCLUDES="-iwrapper\"$SELFPATH/4.3\" $INCLUDES" - SPECIAL="-include \"gccxml_builtins.h\"" -elif [ "$MAJOR_VERSION" = 4 -a "$MINOR_VERSION" -ge 2 ]; then - INCLUDES="-iwrapper\"$SELFPATH/4.2\" $INCLUDES" - SPECIAL="-include \"gccxml_builtins.h\"" -elif [ "$MAJOR_VERSION" = 4 -a "$MINOR_VERSION" -ge 1 ]; then - INCLUDES="-iwrapper\"$SELFPATH/4.1\" $INCLUDES" - SPECIAL="-include \"gccxml_builtins.h\"" -elif [ "$MAJOR_VERSION" = 4 -a "$MINOR_VERSION" -ge 0 ]; then - INCLUDES="-iwrapper\"$SELFPATH/4.0\" $INCLUDES" - SPECIAL="-include \"gccxml_builtins.h\"" -elif [ "$MAJOR_VERSION" = 3 -a "$MINOR_VERSION" -ge 4 ]; then - INCLUDES="-iwrapper\"$SELFPATH/3.4\" $INCLUDES" - SPECIAL="-include \"gccxml_builtins.h\"" -elif [ "$MAJOR_VERSION" = 3 -a "$MINOR_VERSION" = 3 ]; then - INCLUDES="-iwrapper\"$SELFPATH/3.3\" $INCLUDES" - SPECIAL="-include \"gccxml_builtins.h\"" -elif [ "$MAJOR_VERSION" = 3 -a "$MINOR_VERSION" = 2 ]; then - INCLUDES="-iwrapper\"$SELFPATH/3.2\" $INCLUDES" -elif [ "$MAJOR_VERSION" = 3 -a "$MINOR_VERSION" = 1 ]; then - INCLUDES="-iwrapper\"$SELFPATH/3.1\" $INCLUDES" -elif [ "$MAJOR_VERSION" = 3 -a "$MINOR_VERSION" = 0 ]; then - INCLUDES="-iwrapper\"$SELFPATH/3.0\" $INCLUDES" -fi - -# Format and print out the options. -OPTIONS="$MACROS $INCLUDES $SPECIAL" -echo $OPTIONS Modified: gccxml_bin/v09/win32/share/gccxml-0.9/Intel/find_flags =================================================================== --- gccxml_bin/v09/win32/share/gccxml-0.9/Intel/find_flags 2008-12-21 22:28:17 UTC (rev 1483) +++ gccxml_bin/v09/win32/share/gccxml-0.9/Intel/find_flags 2008-12-22 22:11:51 UTC (rev 1484) @@ -1,56 +1,56 @@ -#!/bin/sh -#============================================================================= -# -# Program: GCC-XML -# Module: $RCSfile: find_flags,v $ -# Language: C++ -# Date: $Date: 2005/04/07 12:51:07 $ -# Version: $Revision: 1.5 $ -# -# Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. -# See Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even -# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -# PURPOSE. See the above copyright notices for more information. -# -#============================================================================= - -# Find the GCC executable name. -if test "x$1" = "x" ; then - if test "x${CXX}" = "x" ; then - CXX=gcc - fi -else - CXX="$1" - shift - CXXFLAGS="$@" -fi - -# Find the macro definition options. -MACROS=`echo "" | ${CXX} -x c++ -E -dM ${CXXFLAGS} - 2>/dev/null | - sed -n ' -/^#define / {s/#define \([A-Za-z_][A-Za-z0-9_]*\) \(.*\)/-D\1='\''\2'\''/;p;} -' | - awk ' -BEGIN { first=1 } -/./ { if(first) { printf("%s", $0); first=0 } else { printf(" %s", $0) } } -'` - -# Find the include path options. -INCLUDES=` - echo "" | ${CXX} -v -x c++ -E ${CXXFLAGS} - 2>&1 | - awk '/^[ \t]*-I\/.* \\\\$/ { printf("%s ",$1) } - END {printf("\n")}' - -` - -# The support headers are located where this script is. -SELFPATH=`echo $0 | sed -n '/\//{s/\/find_flags//;p;}'` -if test "x$SELFPATH" = "x" ; then SELFPATH="." ; fi -SELFPATH=`cd "$SELFPATH" ; pwd` - -INCLUDES="-iwrapper\"$SELFPATH\" $INCLUDES" - -# Format and print out the options. -OPTIONS="$MACROS -D_WCHAR_T $INCLUDES" -echo $OPTIONS +#!/bin/sh +#============================================================================= +# +# Program: GCC-XML +# Module: $RCSfile: find_flags,v $ +# Language: C++ +# Date: $Date: 2005-04-07 12:51:07 $ +# Version: $Revision: 1.5 $ +# +# Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. +# See Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even +# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the above copyright notices for more information. +# +#============================================================================= + +# Find the GCC executable name. +if test "x$1" = "x" ; then + if test "x${CXX}" = "x" ; then + CXX=gcc + fi +else + CXX="$1" + shift + CXXFLAGS="$@" +fi + +# Find the macro definition options. +MACROS=`echo "" | ${CXX} -x c++ -E -dM ${CXXFLAGS} - 2>/dev/null | + sed -n ' +/^#define / {s/#define \([A-Za-z_][A-Za-z0-9_]*\) \(.*\)/-D\1='\''\2'\''/;p;} +' | + awk ' +BEGIN { first=1 } +/./ { if(first) { printf("%s", $0); first=0 } else { printf(" %s", $0) } } +'` + +# Find the include path options. +INCLUDES=` + echo "" | ${CXX} -v -x c++ -E ${CXXFLAGS} - 2>&1 | + awk '/^[ \t]*-I\/.* \\\\$/ { printf("%s ",$1) } + END {printf("\n")}' - +` + +# The support headers are located where this script is. +SELFPATH=`echo $0 | sed -n '/\//{s/\/find_flags//;p;}'` +if test "x$SELFPATH" = "x" ; then SELFPATH="." ; fi +SELFPATH=`cd "$SELFPATH" ; pwd` + +INCLUDES="-iwrapper\"$SELFPATH\" $INCLUDES" + +# Format and print out the options. +OPTIONS="$MACROS -D_WCHAR_T $INCLUDES" +echo $OPTIONS Modified: gccxml_bin/v09/win32/share/gccxml-0.9/MIPSpro/find_flags =================================================================== --- gccxml_bin/v09/win32/share/gccxml-0.9/MIPSpro/find_flags 2008-12-21 22:28:17 UTC (rev 1483) +++ gccxml_bin/v09/win32/share/gccxml-0.9/MIPSpro/find_flags 2008-12-22 22:11:51 UTC (rev 1484) @@ -1,137 +1,137 @@ -#!/bin/sh -#============================================================================= -# -# Program: GCC-XML -# Module: $RCSfile: find_flags,v $ -# Language: C++ -# Date: $Date: 2005/08/01 22:11:33 $ -# Version: $Revision: 1.5 $ -# -# Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. -# See Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even -# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -# PURPOSE. See the above copyright notices for more information. -# -#============================================================================= - -# Find the MIPSPro executable name. -if test "x$1" = "x" ; then - if test "x${CXX}" = "x" ; then - CXX=CC - fi -else - CXX="$1" - shift - CXXFLAGS="$@" -fi - -GCCXML_PID="$$" -TESTFILE="find_flags_temp$GCCXML_PID" - -# Construct a test input file that checks for some builtin definitions -# in the compiler that are not displayed by the -v option. This list -# was obtained by running "strings /usr/lib32/cmplrs/fecc" and testing -# for definitions with a giant version of the string below. -echo " -#ifdef _BOOL -D_BOOL _BOOL -#endif -#ifdef _EXPLICIT_IS_KEYWORD -D_EXPLICIT_IS_KEYWORD _EXPLICIT_IS_KEYWORD -#endif -#ifdef _LIBC_IN_NAMESPACE_STD_ -D_LIBC_IN_NAMESPACE_STD_ _LIBC_IN_NAMESPACE_STD_ -#endif -#ifdef _MEMBER_TEMPLATES -D_MEMBER_TEMPLATES _MEMBER_TEMPLATES -#endif -#ifdef _MUTABLE_IS_KEYWORD -D_MUTABLE_IS_KEYWORD _MUTABLE_IS_KEYWORD -#endif -#ifdef _NAMESPACES -D_NAMESPACES _NAMESPACES -#endif -#ifdef _PARTIAL_SPECIALIZATION_OF_CLASS_TEMPLATES -D_PARTIAL_SPECIALIZATION_OF_CLASS_TEMPLATES _PARTIAL_SPECIALIZATION_OF_CLASS_TEMPLATES -#endif -#ifdef _STANDARD_C_PLUS_PLUS -D_STANDARD_C_PLUS_PLUS _STANDARD_C_PLUS_PLUS -#endif -#ifdef _TYPENAME_IS_KEYWORD -D_TYPENAME_IS_KEYWORD _TYPENAME_IS_KEYWORD -#endif -#ifdef _WCHAR_T -D_WCHAR_T _WCHAR_T -#endif -#ifdef _WCHAR_T_IS_KEYWORD -D_WCHAR_T_IS_KEYWORD _WCHAR_T_IS_KEYWORD -#endif -#ifdef __ANSI_CPP__ -D__ANSI_CPP__ __ANSI_CPP__ -#endif -#ifdef __ARRAY_OPERATORS -D__ARRAY_OPERATORS __ARRAY_OPERATORS -#endif -#ifdef __EDG_ABI_COMPATIBILITY_VERSION -D__EDG_ABI_COMPATIBILITY_VERSION __EDG_ABI_COMPATIBILITY_VERSION -#endif -#ifdef __EDG_RUNTIME_USES_NAMESPACES -D__EDG_RUNTIME_USES_NAMESPACES __EDG_RUNTIME_USES_NAMESPACES -#endif -#ifdef __EDG_VERSION__ -D__EDG_VERSION__ __EDG_VERSION__ -#endif -#ifdef __EDG__ -D__EDG__ __EDG__ -#endif -#ifdef __EXCEPTIONS -D__EXCEPTIONS __EXCEPTIONS -#endif -#ifdef __LIBC_MATH_OVERLOAD__ -D__LIBC_MATH_OVERLOAD__ __LIBC_MATH_OVERLOAD__ -#endif -#ifdef __RTTI -D__RTTI __RTTI -#endif -#ifdef __STDC__ -D__STDC__ __STDC__ -#endif -" > /tmp/$TESTFILE.cxx - -# Find the macro definition options. -MACROS=` -${CXX} ${CXXFLAGS} -E -v /tmp/$TESTFILE.cxx 2>&1 | -sed -n '/_COMPILER_VERSION/{s/ \/tmp\/'$TESTFILE'.cxx.*$// -s/ -/\\ --/g;p;}' | -sed -n '/^-D.*$/{s/-D\([^=]*\)=\([^ ]\{1,\} .*\)/-D\1='\''\2'\''/;p;}' | -sed -n 'H;${g;s/\n/ /g;p;}'` - -# Find the internally defined macros. -LANGSTD=` -${CXX} ${CXXFLAGS} -E -v /tmp/$TESTFILE.cxx 2>&1 | -sed -n '/^D/ {s/^D/-D/;s/ /=/;p;}' | -sed -n 'H;${g;s/\n/ /g;p;}'` - -# Find the include path options. -INCLUDES=` -${CXX} ${CXXFLAGS} -E -v /tmp/$TESTFILE.cxx 2>&1 | -sed -n '/_COMPILER_VERSION/{s/ \/tmp\/'$TESTFILE'.cxx.*$// -s/ -/\\ --/g;p;}' | -sed -n '/^-I.*$/{p;}' | -sed -n 'H;${g;s/\n/ /g;p;}'` - -# The support headers are located where this script is. -SELFPATH=`echo $0 | sed -n '/\//{s/\/find_flags//;p;}'` -if test "x$SELFPATH" = "x" ; then SELFPATH="." ; fi -SELFPATH=`cd "$SELFPATH" ; pwd` -INCLUDES="-iwrapper\"$SELFPATH/7.3\" $INCLUDES" - -rm -f /tmp/$TESTFILE.cxx - -# Format and print out the options. -OPTIONS="$MACROS $LANGSTD $INCLUDES" -echo $OPTIONS +#!/bin/sh +#============================================================================= +# +# Program: GCC-XML +# Module: $RCSfile: find_flags,v $ +# Language: C++ +# Date: $Date: 2005-08-01 22:11:33 $ +# Version: $Revision: 1.5 $ +# +# Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. +# See Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even +# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR +# PURPOSE. See the above copyright notices for more information. +# +#============================================================================= + +# Find the MIPSPro executable name. +if test "x$1" = "x" ; then + if test "x${CXX}" = "x" ; then + CXX=CC + fi +else + CXX="$1" + shift + CXXFLAGS="$@" +fi + +GCCXML_PID="$$" +TESTFILE="find_flags_temp$GCCXML_PID" + +# Construct a test input file that checks for some builtin definitions +# in the compiler that are not displayed by the -v option. This list +# was obtained by running "strings /usr/lib32/cmplrs/fecc" and testing +# for definitions with a giant version of the string below. +echo " +#ifdef _BOOL +D_BOOL _BOOL +#endif +#ifdef _EXPLICIT_IS_KEYWORD +D_EXPLICIT_IS_KEYWORD _EXPLICIT_IS_KEYWORD +#endif +#ifdef _LIBC_IN_NAMESPACE_STD_ +D_LIBC_IN_NAMESPACE_STD_ _LIBC_IN_NAMESPACE_STD_ +#endif +#ifdef _MEMBER_TEMPLATES +D_MEMBER_TEMPLATES _MEMBER_TEMPLATES +#endif +#ifdef _MUTABLE_IS_KEYWORD +D_MUTABLE_IS_KEYWORD _MUTABLE_IS_KEYWORD +#endif +#ifdef _NAMESPACES +D_NAMESPACES _NAMESPACES +#endif +#ifdef _PARTIAL_SPECIALIZATION_OF_CLASS_TEMPLATES +D_PARTIAL_SPECIALIZATION_OF_CLASS_TEMPLATES _PARTIAL_SPECIALIZATION_OF_CLASS_TEMPLATES +#endif +#ifdef _STANDARD_C_PLUS_PLUS +D_STANDARD_C_PLUS_PLUS _STANDARD_C_PLUS_PLUS +#endif +#ifdef _TYPENAME_IS_KEYWORD +D_TYPENAME_IS_KEYWORD _TYPENAME_IS_KEYWORD +#endif +#ifdef _WCHAR_T +D_WCHAR_T _WCHAR_T +#endif +#ifdef _WCHAR_T_IS_KEYWORD +D_WCHAR_T_IS_KEYWORD _WCHAR_T_IS_KEYWORD +#endif +#ifdef __ANSI_CPP__ +D__ANSI_CPP__ __ANSI_CPP__ +#endif +#ifdef __ARRAY_OPERATORS +D__ARRAY_OPERATORS __ARRAY_OPERATORS +#endif +#ifdef __EDG_ABI_COMPATIBILITY_VERSION +D__EDG_ABI_COMPATIBILITY_VERSION __EDG_ABI_COMPATIBILITY_VERSION +#endif +#ifdef __EDG_RUNTIME_USES_NAMESPACES +D__EDG_RUNTIME_USES_NAMESPACES __EDG_RUNTIME_USES_NAMESPACES +#endif +#ifdef __EDG_VERSION__ +D__EDG_VERSION__ __EDG_VERSION__ +#endif +#ifdef __EDG__ +D__EDG__ __EDG__ +#endif +#ifdef __EXCEPTIONS +D__EXCEPTIONS __EXCEPTIONS +#endif +#ifdef __LIBC_MATH_OVERLOAD__ +D__LIBC_MATH_OVERLOAD__ __LIBC_MATH_OVERLOAD__ +#endif +#ifdef __RTTI +D__RTTI __RTTI +#endif +#ifdef __STDC__ +D__STDC__ __STDC__ +#endif +" > /tmp/$TESTFILE.cxx + +# Find the macro definition options. +MACROS=` +${CXX} ${CXXFLAGS} -E -v /tmp/$TESTFILE.cxx 2>&1 | +sed -n '/_COMPILER_VERSION/{s/ \/tmp\/'$TESTFILE'.cxx.*$// +s/ -/\\ +-/g;p;}' | +sed -n '/^-D.*$/{s/-D\([^=]*\)=\([^ ]\{1,\} .*\)/-D\1='\''\2'\''/;p;}' | +sed -n 'H;${g;s/\n/ /g;p;}'` + +# Find the internally defined macros. +LANGSTD=` +${CXX} ${CXXFLAGS} -E -v /tmp/$TESTFILE.cxx 2>&1 | +sed -n '/^D/ {s/^D/-D/;s/ /=/;p;}' | +sed -n 'H;${g;s/\n/ /g;p;}'` + +# Find the include path options. +INCLUDES=` +${CXX} ${CXXFLAGS} -E -v /tmp/$TESTFILE.cxx 2>&1 | +sed -n '/_COMPILER_VERSION/{s/ \/tmp\/'$TESTFILE'.cxx.*$// +s/ -/\\ +-/g;p;}' | +sed -n '/^-I.*$/{p;}' | +sed -n 'H;${g;s/\n/ /g;p;}'` + +# The support headers are located where this script is. +SELFPATH=`echo $0 | sed -n '/\//{s/\/find_flags//;p;}'` +if test "x$SELFPATH" = "x" ; then SELFPATH="." ; fi +SELFPATH=`cd "$SELFPATH" ; pwd` +INCLUDES="-iwrapper\"$SELFPATH/7.3\" $INCLUDES" + +rm -f /tmp/$TESTFILE.cxx + +# Format and print out the options. +OPTIONS="$MACROS $LANGSTD $INCLUDES" +echo $OPTIONS Added: gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/Include/CodeAnalysis/sourceannotations.h =================================================================== --- gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/Include/CodeAnalysis/sourceannotations.h (rev 0) +++ gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/Include/CodeAnalysis/sourceannotations.h 2008-12-22 22:11:51 UTC (rev 1484) @@ -0,0 +1,289 @@ +#if _MSC_VER >= 1400 + +#pragma once + +#ifndef _M_CEE_SAFE // Source annotation attributes don't work with /clr:safe + +#if !defined(_W64) +#if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 +#define _W64 __w64 +#else +#define _W64 +#endif +#endif + +#ifndef _SIZE_T_DEFINED +#ifdef _WIN64 +typedef unsigned __int64 size_t; +#else +typedef _W64 unsigned int size_t; +#endif +#define _SIZE_T_DEFINED +#endif + +#ifndef _WCHAR_T_DEFINED +typedef unsigned short wchar_t; +#define _WCHAR_T_DEFINED +#endif + + +#pragma push_macro( "SA" ) +#pragma push_macro( "REPEATABLE" ) + +#ifdef __cplusplus +#define SA( id ) id +#define REPEATABLE +#else // !__cplusplus +#define SA( id ) SA_##id +#define REPEATABLE +#endif // !__cplusplus + +#ifdef __cplusplus +namespace vc_attributes +{ +#endif // __cplusplus + +enum SA( YesNoMaybe ) +{ + // Choose values that we can detect as invalid if they are or'd together + SA( No ) = 0x0fff0001, + SA( Maybe ) = 0x0fff0010, + SA( Yes ) = 0x0fff0100 +}; + +typedef enum SA( YesNoMaybe ) SA( YesNoMaybe ); + +enum SA( AccessType ) +{ + SA( NoAccess ) = 0, + SA( Read ) = 1, + SA( Write ) = 2, + SA( ReadWrite ) = 3 +}; + +typedef enum SA( AccessType ) SA( AccessType ); + +#ifndef SAL_NO_ATTRIBUTE_DECLARATIONS + +REPEATABLE +struct PreAttribute +{ +#ifdef __cplusplus + PreAttribute(); +#endif + + unsigned int Deref; + SA( YesNoMaybe ) Valid; + SA( YesNoMaybe ) Null; + SA( YesNoMaybe ) Tainted; + SA( AccessType ) Access; + size_t ValidElementsConst; + size_t ValidBytesConst; + const wchar_t* ValidElements; + const wchar_t* ValidBytes; + const wchar_t* ValidElementsLength; + const wchar_t* ValidBytesLength; + size_t WritableElementsConst; + size_t WritableBytesConst; + const wchar_t* WritableElements; + const wchar_t* WritableBytes; + const wchar_t* WritableElementsLength; + const wchar_t* WritableBytesLength; + size_t ElementSizeConst; + const wchar_t* ElementSize; + SA( YesNoMaybe ) NullTerminated; + const wchar_t* Condition; +}; + +REPEATABLE +struct PostAttribute +{ +#ifdef __cplusplus + PostAttribute(); +#endif + + unsigned int Deref; + SA( YesNoMaybe ) Valid; + SA( YesNoMaybe ) Null; + SA( YesNoMaybe ) Tainted; + SA( AccessType ) Access; + size_t ValidElementsConst; + size_t ValidBytesConst; + const wchar_t* ValidElements; + const wchar_t* ValidBytes; + const wchar_t* ValidElementsLength; + const wchar_t* ValidBytesLength; + size_t WritableElementsConst; + size_t WritableBytesConst; + const wchar_t* WritableElements; + const wchar_t* WritableBytes; + const wchar_t* WritableElementsLength; + const wchar_t* WritableBytesLength; + size_t ElementSizeConst; + const wchar_t* ElementSize; + SA( YesNoMaybe ) NullTerminated; + SA( YesNoMaybe ) MustCheck; + const wchar_t* Condition; +}; + +struct FormatStringAttribute +{ +#ifdef __cplusplus + FormatStringAttribute(); +#endif + + const wchar_t* Style; + const wchar_t* UnformattedAlternative; +}; + +REPEATABLE +struct InvalidCheckAttribute +{ +#ifdef __cplusplus + InvalidCheckAttribute(); +#endif + + long Value; +}; + +struct SuccessAttribute +{ +#ifdef __cplusplus + SuccessAttribute(); +#endif + + const wchar_t* Condition; +}; + +REPEATABLE +struct PreBoundAttribute +{ +#ifdef __cplusplus + PreBoundAttribute(); +#endif + unsigned int Deref; +}; + +REPEATABLE +struct PostBoundAttribute +{ +#ifdef __cplusplus + PostBoundAttribute(); +#endif + unsigned int Deref; +}; + +REPEATABLE +struct PreRangeAttribute +{ +#ifdef __cplusplus + PreRangeAttribute(); +#endif + unsigned int Deref; + const char* MinVal; + const char* MaxVal; +}; + +REPEATABLE +struct PostRangeAttribute +{ +#ifdef __cplusplus + PostRangeAttribute(); +#endif + unsigned int Deref; + const char* MinVal; + const char* MaxVal; +}; + +#endif // !SAL_NO_ATTRIBUTE_DECLARATIONS + +#ifdef __cplusplus +}; // namespace vc_attributes +#endif // __cplusplus + +#pragma pop_macro( "REPEATABLE" ) +#pragma pop_macro( "SA" ) + +#ifdef __cplusplus + +#define SA_All All +#define SA_Class Class +#define SA_Constructor Constructor +#define SA_Delegate Delegate +#define SA_Enum Enum +#define SA_Event Event +#define SA_Field Field +#define SA_GenericParameter GenericParameter +#define SA_Interface Interface +#define SA_Method Method +#define SA_Module Module +#define SA_Parameter Parameter +#define SA_Property Property +#define SA_ReturnValue ReturnValue +#define SA_Struct Struct + +typedef ::vc_attributes::YesNoMaybe SA_YesNoMaybe; +const ::vc_attributes::YesNoMaybe SA_Yes = ::vc_attributes::Yes; +const ::vc_attributes::YesNoMaybe SA_No = ::vc_attributes::No; +const ::vc_attributes::YesNoMaybe SA_Maybe = ::vc_attributes::Maybe; + +typedef ::vc_attributes::AccessType SA_AccessType; +const ::vc_attributes::AccessType SA_NoAccess = ::vc_attributes::NoAccess; +const ::vc_attributes::AccessType SA_Read = ::vc_attributes::Read; +const ::vc_attributes::AccessType SA_Write = ::vc_attributes::Write; +const ::vc_attributes::AccessType SA_ReadWrite = ::vc_attributes::ReadWrite; + +#ifndef SAL_NO_ATTRIBUTE_DECLARATIONS +typedef ::vc_attributes::PreAttribute SA_Pre; +typedef ::vc_attributes::PostAttribute SA_Post; +typedef ::vc_attributes::FormatStringAttribute SA_FormatString; +typedef ::vc_attributes::InvalidCheckAttribute SA_InvalidCheck; /*???*/ +typedef ::vc_attributes::SuccessAttribute SA_Success; +typedef ::vc_attributes::PreBoundAttribute SA_PreBound; +typedef ::vc_attributes::PostBoundAttribute SA_PostBound; +typedef ::vc_attributes::PreRangeAttribute SA_PreRange; +typedef ::vc_attributes::PostRangeAttribute SA_PostRange; +#endif //!SAL_NO_ATTRIBUTE_DECLARATIONS + +#else // !__cplusplus + +typedef struct PreAttribute SA_Pre; +typedef struct PreAttribute PreAttribute; +typedef struct PostAttribute SA_Post; +typedef struct PostAttribute PostAttribute; +typedef struct FormatStringAttribute SA_FormatString; +typedef struct InvalidCheckAttribute SA_InvalidCheck; /*???*/ +typedef struct SuccessAttribute SA_Success; +typedef struct PreBoundAttribute SA_PreBound; +typedef struct PostBoundAttribute SA_PostBound; +typedef struct PreRangeAttribute SA_PreRange; +typedef struct PostRangeAttribute SA_PostRange; + +#endif // __cplusplus + +#endif // !_M_CEE_SAFE + +#ifdef _MANAGED + +#ifdef CODE_ANALYSIS +#define SA_SUPPRESS_MESSAGE( category, id, ... ) [::System::Diagnostics::CodeAnalysis::SuppressMessage( category, id, __VA_ARGS__ )] +#define CA_SUPPRESS_MESSAGE( ... ) [System::Diagnostics::CodeAnalysis::SuppressMessage( __VA_ARGS__ )] +#define CA_GLOBAL_SUPPRESS_MESSAGE( ... ) [assembly:System::Diagnostics::CodeAnalysis::SuppressMessage( __VA_ARGS__ )] +#else // !CODE_ANALYSIS +#define SA_SUPPRESS_MESSAGE( category, id, ... ) +#define CA_SUPPRESS_MESSAGE( ... ) +#define CA_GLOBAL_SUPPRESS_MESSAGE( ... ) +#endif // !CODE_ANALYSIS + +#endif // _MANAGED + +// Windows SDK Update Vista Beta2 (June 2006): __analysis_assume defined by specstrings.h +#ifdef _PREFAST_ +// #define __analysis_assume(expr) __assume(expr) +#else // !_PREFAST_ +// #define __analysis_assume(expr) +#endif // _PREFAST_ + + +#endif // _MSC_VER >= 1400 + Added: gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/Include/algorithm =================================================================== --- gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/Include/algorithm (rev 0) +++ gccxml_bin/v09/win32/share/gccxml-0.9/Vc9/Include/algorithm 2008-12-22 22:11:51 UTC (rev 1484) @@ -0,0 +1,5832 @@ +// algorithm standard header +#pragma once +#ifndef _ALGORITHM_ +#define _ALGORITHM_ +#ifndef RC_INVOKED +#include <memory> + +#ifdef _MSC_VER + #pragma pack(push,_CRT_PACKING) + #pragma warning(push,3) + #pragma warning(disable: 4244) +#endif /* _MSC_VER */ + +/* ------------------------------------------------------------------------ */ +/* Forward declare these now because they are used as non-dependent names. */ +_STDEXT_BEGIN +template<class _InIt, class _OutIt, class _Ty> +inline _OutIt unchecked_remove_copy(_InIt _First, _InIt _Last, + _OutIt _Dest, const _Ty& _Val); +template<class _InIt, class _OutIt, class _Pr> +inline _OutIt unchecked_remove_copy_if(_InIt _First, _InIt _Last, + _OutIt _Dest, _Pr _Pred); +template<class _InIt1, class _InIt2, class _OutIt> +inline _OutIt unchecked_merge(_InIt1 _First1, _InIt1 _Last1, + _InIt2 _First2, _InIt2 _Last2, _OutIt _Dest); +template<class _InIt1, class _InIt2, class _OutIt, class _Pr> +inline _OutIt unchecked_merge(_InIt1 _First1, _InIt1 _Last1, + _InIt2 _First2, _InIt2 _Last2, _OutIt _Dest, + _Pr _Pred); +template<class _BidIt1, class _BidIt2, class _BidIt3> +inline _BidIt3 _Unchecked_merge_backward(_BidIt1 _First1, _BidIt1 _Last1, + _BidIt2 _First2, _BidIt2 _Last2, + _BidIt3 _Dest); +template<class _BidIt1, class _BidIt2, class _BidIt3, class _Pr> +inline _BidIt3 _Unchecked_merge_backward(_BidIt1 _First1, _BidIt1 _Last1, + _BidIt2 _First2, _BidIt2 _Last2, + _BidIt3 _Dest, _Pr _Pred); +template<class _BidIt, class _OutIt, class _Diff> +inline void _Unchecked_chunked_merge(_BidIt _First, _BidIt _Last, + _OutIt _Dest, _Diff _Chunk, + _Diff _Count); +template<class _BidIt, class _OutIt, class _Diff, class _Pr> +inline void _Unchecked_chunked_merge(_BidIt _First, _BidIt _Last, + _OutIt _Dest, _Diff _Chunk, + _Diff _Count, _Pr _Pred); +_STDEXT_END +/* ------------------------------------------------------------------------ */ + +_STD_BEGIN + + // COMMON SORT PARAMETERS +const int _ISORT_MAX = 32; // maximum size for insertion sort + + // TEMPLATE FUNCTION for_each +template<class _InIt, + class _Fn1> inline + _Fn1 for_each(_InIt _First, _InIt _Last, _Fn1 _Func) + { // perform function for each element + _DEBUG_RANGE(_First, _Last); + _DEBUG_POINTER(_Func); + _CHECKED_BASE_TYPE(_InIt) _ChkFirst(_CHECKED_BASE(_First)); + _CHECKED_BASE_TYPE(_InIt) _ChkLast(_CHECKED_BASE(_Last)); + for (; _ChkFirst != _ChkLast; ++_ChkFirst) + _Func(*_ChkFirst); + return (_Func); + } + + // TEMPLATE FUNCTION find +template<class _InIt, class _Ty> +inline + _InIt _Find(_InIt _First, _InIt _Last, const _Ty& _Val) + { // find first matching _Val + _DEBUG_RANGE(_First, _Last); + for (; _First != _Last; ++_First) + if (*_First == _Val) + break; + return (_First); + } + +inline const char *_Find(const char *_First, const char *_Last, int _Val) + { // find first char that matches _Val + _DEBUG_RANGE(_First, _Last); + _First = (const char *)::memchr(_First, _Val, _Last - _First); + return (_First == 0 ? _Last : _First); + } + +inline const signed char *_Find(const signed char *_First, + const signed char *_Last, int _Val) + { // find first signed char that matches _Val + _DEBUG_RANGE(_First, _Last); + _First = (const signed char *)::memchr(_First, _Val, + _Last - _First); + return (_First == 0 ? _Last : _First); + } + +inline const unsigned char *_Find(const unsigned char *_First, + const unsigned char *_Last, int _Val) + { // find first unsigned char that matches _Val + _DEBUG_RANGE(_First, _Last); + _First = (const unsigned char *)::memchr(_First, _Val, + _Last - _First); + return (_First == 0 ? _Last : _First); + } + +template<class _InIt, class _Ty> +inline + _InIt find(_InIt _First, _InIt _Last, const _Ty& _Val) + { // find first matching _Val + _ASSIGN_FROM_BASE(_First, + _Find(_CHECKED_BASE(_First), _CHECKED_BASE(_Last), _Val)); + return (_First); + } + + // TEMPLATE FUNCTION find_if +template<class _InIt, + class _Pr> inline + _InIt _Find_if(_InIt _First, _InIt _Last, _Pr _Pred) + { // find first satisfying _Pred + _DEBUG_RANGE(_First, _Last); + _DEBUG_POINTER(_Pred); + for (; _First != _Last; ++_First) + if (_Pred(*_First)) + break; + return (_First); + } + +template<class _InIt, + class _Pr> inline + _InIt find_if(_InIt _First, _InIt _Last, _Pr _Pred) + { // find first satisfying _Pred + _ASSIGN_FROM_BASE(_First, + _Find_if(_CHECKED_BASE(_First), _CHECKED_BASE(_Last), _Pred)); + return (_First); + } + + // TEMPLATE FUNCTION adjacent_find +template<class _FwdIt> inline + _FwdIt _Adjacent_find(_FwdIt _First, _FwdIt _Last) + { // find first matching successor + _DEBUG_RANGE(_First, _Last); + for (_FwdIt _Firstb; (_Firstb = _First) != _Last && ++_First != _Last; ) + if (*_Firstb == *_First) + return (_Firstb); + return (_Last); + } + +template<class _FwdIt> inline + _FwdIt adjacent_find(_FwdIt _First, _FwdIt _Last) + { // find first matching successor + _ASSIGN_FROM_BASE(_First, + _Adjacent_find(_CHECKED_BASE(_First), _CHECKED_BASE(_Last))); + return (_First); + } + + // TEMPLATE FUNCTION adjacent_find WITH PRED +template<class _FwdIt, + class _Pr> inline + _FwdIt _Adjacent_find(_FwdIt _First, _FwdIt _Last, _Pr _Pred) + { // find first satisfying _Pred with successor + _DEBUG_RANGE(_First, _Last); + _DEBUG_POINTER(_Pred); + for (_FwdIt _Firstb; (_Firstb = _First) != _Last && ++_First != _Last; ) + if (_Pred(*_Firstb, *_First)) + return (_Firstb); + return (_Last); + } + +template<class _FwdIt, + class _Pr> inline + _FwdIt adjacent_find(_FwdIt _First, _FwdIt _Last, _Pr _Pred) + { // find first satisfying _Pred with successor + _ASSIGN_FROM_BASE(_First, + _Adjacent_find(_CHECKED_BASE(_First), _CHECKED_BASE(_Last), _Pred)); + return (_First); + } + + // TEMPLATE FUNCTION count +template<class _InIt, + class _Ty> inline + typename iterator_traits<_InIt>::difference_type + _Count(_InIt _First, _InIt _Last, const _Ty& _Val) + { // count elements that match _Val + _DEBUG_RANGE(_First, _Last); + typename iterator_traits<_InIt>::difference_type _Cnt = 0; + + for (; _First != _Last; ++_First) + if (*_First == _Val) + ++_Cnt; + return (_Cnt); + } + +template<class _InIt, + class _Ty> inline + typename iterator_traits<_InIt>::difference_type + count(_InIt _First, _InIt _Last, const _Ty& _Val) + { // count elements that match _Val + return _Count(_CHECKED_BASE(_First), _CHECKED_BASE(_Last), _Val); + } + + // TEMPLATE FUNCTION count_if +template<class _InIt, + class _Pr> inline + typename iterator_traits<_InIt>::difference_type + _Count_if(_InIt _First, _InIt _Last, _Pr _Pred) + { // count elements satisfying _Pred + _DEBUG_RANGE(_First, _Last); + _DEBUG_POINTER(_Pred); + typename iterator_traits<_InIt>::difference_type _Count = 0; + + for (; _First != _Last; ++_First) + if (_Pred(*_First)) + ++_Count; + return (_Count); + } + +template<class _InIt, + class _Pr> inline + typename iterator_traits<_InIt>::difference_type + count_if(_InIt _First, _InIt _Last, _Pr _Pred) + { // count elements satisfying _Pred + return _Count_if(_CHECKED_BASE(_First), _CHECKED_BASE(_Last), _Pred); + } + + // TEMPLATE FUNCTION search +template<class _FwdIt1, + class _FwdIt2, + class _Diff1, + class _Diff2> inline + _FwdIt1 _Search(_FwdIt1 _First1, _FwdIt1 _Last1, + _FwdIt2 _First2, _FwdIt2 _Last2, _Diff1 *, _Diff2 *) + { // find first [_First2, _Last2) match + _DEBUG_RANGE(_First1, _Last1); + _DEBUG_RANGE(_First2, _Last2); + _Diff1 _Count1 = 0; + _Distance(_First1, _Last1, _Count1); + _Diff2 _Count2 = 0; + _Distance(_First2, _Last2, _Count2); + + for (; _Count2 <= _Count1; ++_First1, --_Count1) + { // room for match, try it + _FwdIt1 _Mid1 = _First1; + for (_FwdIt2 _Mid2 = _First2; ; ++_Mid1, ++_Mid2) + if (_Mid2 == _Last2) + return (_First1); + else if (!(*_Mid1 == *_Mid2)) + break; + } + return (_Last1); + } + +template<class _FwdIt1, + class _FwdIt2> inline + _FwdIt1 search(_FwdIt1 _First1, _FwdIt1 _Last1, + _FwdIt2 _First2, _FwdIt2 _Last2) + { // find first [_First2, _Last2) match + _ASSIGN_FROM_BASE(_First1, + _Search(_CHECKED_BASE(_First1), _CHECKED_BASE(_Last1), + _CHECKED_BASE(_First2), _CHECKED_BASE(_Last2), + _Dist_type(_First1), _Dist_type(_First2))); + return _First1; + } + + // TEMPLATE FUNCTION search WITH PRED +template<class _FwdIt1, + class _FwdIt2, + class _Diff1, + class _Diff2, + class _Pr> inline + _FwdIt1 _Search(_FwdIt1 _First1, _FwdIt1 _Last1, + _FwdIt2 _First2, _FwdIt2 _Last2, _Pr _Pred, _Diff1 *, _Diff2 *) + { // find first [_First2, _Last2) satisfying _Pred + _DEBUG_RANGE(_First1, _Last1); + _DEBUG_RANGE(_First2, _Last2); + _DEBUG_POINTER(_Pred); + _Diff1 _Count1 = 0; + _Distance(_First1, _Last1, _Count1); + _Diff2 _Count2 = 0; + _Distance(_First2, _Last2, _Count2); + + for (; _Count2 <= _Count1; ++_First1, --_Count1) + { // room for match, try it + _FwdIt1 _Mid1 = _First1; + for (_FwdIt2 _Mid2 = _First2; ; ++_Mid1, ++_Mid2) + if (_Mid2 == _Last2) + return (_First1); + else if (!_Pred(*_Mid1, *_Mid2)) + break; + } + return (_Last1); + } + +template<class _FwdIt1, + class _FwdIt2, + class _Pr> inline + _FwdIt1 search(_FwdIt1 _First1, _FwdIt1 _Last1, + _FwdIt2 _First2, _FwdIt2 _Last2, _Pr _Pred) + { // find first [_First2, _Last2) satisfying _Pred + _ASSIGN_FROM_BASE(_First1, + _Search(_CHECKED_BASE(_First1), _CHECKED_BASE(_Last1), + _CHECKED_BASE(_First2), _CHECKED_BASE(_Last2), _Pred, + _Dist_type(_First1), _Dist_type(_First2))); + return _First1; + } + + // TEMPLATE FUNCTION search_n +template<class _FwdIt1, + class _Diff2, + class _Ty> inline + _FwdIt1 _Search_n(_FwdIt1 _First1, _FwdIt1 _Last1, + _Diff2 _Count, const _Ty& _Val, forward_iterator_tag) + { // find first _Count * _Val match, forward iterators + _DEBUG_RANGE(_First1, _Last1); + + if (_Count <= 0) + return (_First1); + + for (; _First1 != _Last1; ++_First1) + if (*_First1 == _Val) + { // found start of possible match, check it out + _FwdIt1 _Mid1 = _First1; + + for (_Diff2 _Count1 = _Count; ; ) + if (--_Count1 == 0) + return (_First1); // found rest of match, report it + else if (++_Mid1 == _Last1) + return (_Last1); // short match at end + else if (!(*_Mid1 == _Val)) + break; // short match not at end + + _First1 = _Mid1; // pick up just beyond failed match + } + return (_Last1); + } + +template<class _FwdIt1, + class _Diff2, + class _Ty> inline + _FwdIt1 _Search_n(_FwdIt1 _First1, _FwdIt1 _Last1, + _Diff2 _Count, const _Ty& _Val, random_access_iterator_tag) + { // find first _Count * _Val match, random-access iterators + _DEBUG_RANGE(_First1, _Last1); + + if (_Count <= 0) + return (_First1); + + _FwdIt1 _Oldfirst1 = _First1; + for (_Diff2 _Inc = 0; _Count <= _Last1 - _Oldfirst1; ) + { // enough room, look for a match + _First1 = _Oldfirst1 + _Inc; + if (*_First1 == _Val) + { // found part of possible match, check it out + _Diff2 _Count1 = _Count; + _FwdIt1 _Mid1 = _First1; + + for (; _Oldfirst1 != _First1 && _First1[-1] == _Val; --_First1) + --_Count1; // back up over any skipped prefix + + if (_Count1 <= _Last1 - _Mid1) + for (; ; ) // enough left, test suffix + if (--_Count1 == 0) + return (_First1); // found rest of match, report it + else if (!(*++_Mid1 == _Val)) + break; // short match not at end + + _Oldfirst1 = ++_Mid1; // failed match, take small jump + _Inc = 0; + } + else + { // no match, take big jump and back up as needed + _Oldfirst1 = _First1 + 1; + _Inc = _Count - 1; + } + } + return (_Last1); + } + +template<class _FwdIt1, + class _Diff2, + class _Ty> inline + _FwdIt1 search_n(_FwdIt1 _First1, _FwdIt1 _Last1, + _Diff2 _Count, const _Ty& _Val) + { // find first _Count * _Val match + _ASSIGN_FROM_BASE(_First1, + _Search_n(_CHECKED_BASE(_First1), _CHECKED_BASE(_Last1), _Count, _Val, + _Iter_cat(_First1))); + return _First1; + } + + // TEMPLATE FUNCTION search_n WITH PRED +template<class _FwdIt1, + class _Diff2, + class _Ty, + class _Pr> inline + _FwdIt1 _Search_n(_FwdIt1 _First1, _FwdIt1 _Last1, + _Diff2 _Count, const _Ty& _Val, _Pr _Pred, forward_iterator_tag) + { // find first _Count * _Val satisfying _Pred, forward iterators + _DEBUG_RANGE(_First1, _Last1); + _DEBUG_POINTER(_Pred); + + if (_Count <= 0) + return (_First1); + + for (; _First1 != _Last1; ++_First1) + if (_Pred(*_First1, _Val)) + { // found start of possible match, check it out + _FwdIt1 _Mid1 = _First1; + + for (_Diff2 _Count1 = _Count; ; ) + if (--_Count1 == 0) + return (_First1); // found rest of match, report it + else if (++_Mid1 == _Last1) + return (_Last1); // short match at end + else if (!_Pred(*_Mid1, _Val)) + break; // short match not at end + + _First1 = _Mid1; // pick up just beyond failed match + } + return (_Last1); + } + +template<class _FwdIt1, + class _Diff2, + class _Ty, + class _Pr> inline + _FwdIt1 _Search_n(_FwdIt1 _First1, _FwdIt1 _Last1, + _Diff2 _Count, const _Ty& _Val, _Pr _Pred, random_access_iterator_tag) + { // find first _Count * _Val satisfying _Pred, random-access iterators + _DEBUG_RANGE(_First1, _Last1); + _DEBUG_POINTER(_Pred); + + if (_Count <= 0) + return (_First1); + + _FwdIt1 _Oldfirst1 = _First1; + for (; _Count <= _Last1 - _Oldfirst1; ) + { // enough room, look for a match + if (_Pred(*_First1, _Val)) + { // found part of possible match, check it out + _Diff2 _Count1 = _Count; + _FwdIt1 _Mid1 = _First1; + + for (; _Oldfirst1 != _First1 && _Pred(_First1[-1], _Val); + --_First1) + --_Count1; // back up over any skipped prefix + + if (_Count1 <= _Last1 - _Mid1) + for (; ; ) // enough left, test suffix + if (--_Count1 == 0) + return (_First1); // found rest of match, report it + else if (!_Pred(*++_Mid1, _Val)) + break; // short match not at end + + _Oldfirst1 = ++_Mid1; // failed match, take small jump + _First1 = _Oldfirst1; + } + else + { // no match, take big jump and back up as needed + _Oldfirst1 = _First1 + 1; + _First1 += _Count; + } + } + return (_Last1); + } + +template<class _FwdIt1, + class _Diff2, + class _Ty, + class _Pr> inline + _FwdIt1 search_n(_FwdIt1 _First1, _FwdIt1 _Last1, + _Diff2 _Count, const _Ty& _Val, _Pr _Pred) + { // find first _Count * _Val satisfying _Pred + _ASSIGN_FROM_BASE(_First1, + _Search_n(_CHECKED_BASE(_First1), _CHECKED_BASE(_Last1), _Count, _Val, _Pred, + _Iter_cat(_First1))); + return _First1; + } + + // TEMPLATE FUNCTION find_end +template<class _FwdIt1, + class _FwdIt2, + class _Diff1, + class _Diff2> inline + _FwdIt1 _Find_end(_FwdIt1 _First1, _FwdIt1 _Last1, + _FwdIt2 _First2, _FwdIt2 _Last2, _Diff1 *, _Diff2 *) + { // find last [_First2, _Last2) match + _DEBUG_RANGE(_First1, _Last1); + _DEBUG_RANGE(_First2, _Last2); + _Diff1 _Count1 = 0; + _Distance(_First1, _Last1, _Count1); + _Diff2 _Count2 = 0; + _Distance(_First2, _Last2, _Count2); + _FwdIt1 _Ans = _Last1; + + if (0 < _Count2) + for (; _Count2 <= _Count1; ++_First1, --_Count1) + { // room for match, try it + _FwdIt1 _Mid1 = _First1; + for (_FwdIt2 _Mid2 = _First2; ; ++_Mid1) + if (!(*_Mid1 == *_Mid2)) + break; + else if (++_Mid2 == _Last2) + { // potential answer, save it + _Ans = _First1; + break; + } + } + return (_Ans); + } + +template<class _FwdIt1, + class _FwdIt2> inline + _FwdIt1 find_end(_FwdIt1 _First1, _FwdIt1 _Last1, + _FwdIt2 _First2, _FwdIt2 _Last2) + { // find last [_First2, _Last2) match + _ASSIGN_FROM_BASE(_First1, + _Find_end(_CHECKED_BASE(_First1), _CHECKED_BASE(_Last1), + _CHECKED_BASE(_First2), _CHECKED_BASE(_Last2), + _Dist_type(_First1), _Dist_type(_First2))); + return _First1; + } + + // TEMPLATE FUNCTION find_end WITH PRED +template<class _FwdIt1, + class _FwdIt2, + class _Diff1, + class _Diff2, + class _Pr> inline + _FwdIt1 _Find_end(_FwdIt1 _First1, _FwdIt1 _Last1, + _FwdIt2 _First2, _FwdIt2 _Last2, _Pr _Pred, _Diff1 *, _Diff2 *) + { // find last [_First2, _Last2) satisfying _Pred + _DEBUG_RANGE(_First1, _Last1); + _DEBUG_RANGE(_First2, _Last2); + _DEBUG_POINTER(_Pred); + _Diff1 _Count1 = 0; + _Distance(_First1, _Last1, _Count1); + _Diff2 _Count2 = 0; + _Distance(_First2, _Last2, _Count2); + _FwdIt1 _Ans = _Last1; + + if (0 < _Count2) + for (; _Count2 <= _Count1; ++_First1, --_Count1) + { // room for match, try it + _FwdIt1 _Mid1 = _First1; + for (_FwdIt2 _Mid2 = _First2; ; ++_Mid1) + if (!_Pred(*_Mid1, *_Mid2)) + break; + else if (++_Mid2 == _Last2) + { // potential answer, save it + _Ans = _First1; + break; + } + } + return (_Ans); + } + +template<class _FwdIt1, + class _FwdIt2, + class _Pr> inline + _FwdIt1 find_end(_FwdIt1 _First1, _FwdIt1 _Last1, + _FwdIt2 _First2, _FwdIt2 _Last2, _Pr _Pred) + { // find last [_First2, _Last2) satisfying _Pred + _ASSIGN_FROM_BASE(_First1, + _Find_end(_CHECKED_BASE(_First1), _CHECKED_BASE(_Last1), + _CHECKED_BASE(_First2), _CHECKED_BASE(_Last2), _Pred, + _Dist_type(_First1), _Dist_type(_First2))); + return _First1; + } + + // TEMPLATE FUNCTION find_first_of +template<class _FwdIt1, + class _FwdIt2> inline + _FwdIt1 _Find_first_of(_FwdIt1 _First1, _FwdIt1 _Last1, + _FwdIt2 _First2, _FwdIt2 _Last2) + { // look for one of [_First2, _Last2) that matches element + _DEBUG_RANGE(_First1, _Last1); + _DEBUG_RANGE(_First2, _Last2); + for (; _First1 != _Last1; ++_First1) + for (_FwdIt2 _Mid2 = _First2; _Mid2 != _Last2; ++_Mid2) + if (*_First1 == *_Mid2) + return (_First1); + return (_First1); + } + +template<class _FwdIt1, + class _FwdIt2> inline + _FwdIt1 find_first_of(_FwdIt1 _First1, _FwdIt1 _Last1, + _FwdIt2 _First2, _FwdIt2 _Last2) + { // look for one of [_First2, _Last2) that matches element + _DEBUG_RANGE(_First1, _Last1); + _DEBUG_RANGE(_First2, _Last2); + _ASSIGN_FROM_BASE(_First1, + _Find_first_of(_CHECKED_BASE(_First1), _CHECKED_BASE(_Last1), + _CHECKED_BASE(_First2), _CHECKED_BASE(_Last2))); + return _First1; + } + + // TEMPLATE FUNCTION find_first_of WITH PRED +template<class _FwdIt1, + class _FwdIt2, + class _Pr> inline + _FwdIt1 _Find_first_of(_FwdIt1 _First1, _FwdIt1 _Last1, + _FwdIt2 _First2, _FwdIt2 _Last2, _Pr _Pred) + { // look for one of [_First2, _Last2) satisfying _Pred with element + _DEBUG_POINTER(_Pred); + for (; _First1 != _Last1; ++_First1) + for (_FwdIt2 _Mid2 = _First2; _Mid2 != _Last2; ++_Mid2) + if (_Pred(*_First1, *_Mid2)) + return (_First1); + return (_First1); + } + +template<class _FwdIt1, + class _FwdIt2, + class _Pr> inline + _FwdIt1 find_first_of(_FwdIt1 _First1, _FwdIt1 _Last1, + _FwdIt2 _First2, _FwdIt2 _Last2, _Pr _Pred) + { // look for one of [_First2, _Last2) satisfying _Pred with element + _ASSIGN_FROM_BASE(_First1, + _Find_first_of(_CHECKED_BASE(_First1), _CHECKED_BASE(_Last1), + _CHECKED_BASE(_First2), _CHECKED_BASE(_Last2), _Pred)); + return (_First1); + } + + // TEMPLATE FUNCTION iter_swap +template<class _FwdIt1, + class _FwdIt2> inline + void iter_swap(_FwdIt1 _Left, _FwdIt2 _Right) + { // swap *_Left and *_Right + swap(*_Left, *_Right); + } + + // TEMPLATE FUNCTION swap_ranges +template<class _FwdIt1, class _FwdIt2, class _FwdItCats> +inline + _FwdIt2 _Swap_ranges(_FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, + _FwdItCats, _Range_checked_iterator_tag) + { // swap [_First1, _Last1) with [_First2, ...) + _DEBUG_RANGE(_First1, _Last1); + for (; _First1 != _Last1; ++_First1, ++_First2) + std::iter_swap(_First1, _First2); + return (_First2); + } + +#if _SECURE_SCL +template<class _FwdIt1, class _FwdIt2> +inline + _FwdIt2 _Swap_ranges(_FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2, + random_access_iterator_tag, _Range_checked_iterator_tag) + { // swap [_First1, _Last1) with [_First2, ...) + // if _FwdIt2 is range checked, this will make sure there is enough space + _FwdIt2 _Result = _First2 + (_Last1 - _First1); + _Swap_ranges(_First1, _Last1, _CHECKED_BASE(_First2), + forward_iterator_tag(), _Range_checked_iterator_tag()); + return (_Result); + } +#endif + +#if _SECURE_SCL + +template<class _FwdIt1, class _FwdIt2> +inline +_IF_CHK(_FwdIt2) swap_ranges(_FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2) + { + return _Swap_ranges(_CHECKED_BASE(_First1), _CHECKED_BASE(_Last1), _First2, + _Iter_random(_First1, _First2), _STD _Range_checked_iterator_tag()); + } + +template<class _FwdIt1, class _FwdElem2, size_t _Size> +inline +_FwdElem2* swap_ranges(_FwdIt1 _First1, _FwdIt1 _Last1, _FwdElem2 (&_First2)[_Size]) + { + return (swap_ranges(_First1, _Last1, _STDEXT make_checked_array_iterator(_First2, _Size)).base()); + } + +template<class _FwdIt1, class _FwdIt2> +inline +_SCL_INSECURE_DEPRECATE +_IF_NOT_CHK(_FwdIt2) swap_ranges(_FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2) + { + return _Swap_ranges(_CHECKED_BASE(_First1), _CHECKED_BASE(_Last1), _First2, + _Iter_random(_First1, _First2), _STD _Range_checked_iterator_tag()); + } + +#else + +template<class _FwdIt1, class _FwdIt2> +inline + _FwdIt2 swap_ranges(_FwdIt1 _First1, _FwdIt1 _Last1, _FwdIt2 _First2) + { + return _Swap_ranges(_CHECKED_BASE(_First1), _CHECKED_BASE(_Last1), _First2, + _Iter_random(_First1, _First2), _STD _Range_checked_iterator_tag()); + } + +#endif + + // TEMPLATE FUNCTION transform WITH UNARY OP +template<class _InIt, class _OutIt, class _Fn1, class _InOutItCat> +inline + _OutIt _Transform(_InIt _First, _InIt _Last, _OutIt _Dest, _Fn1 _Func, + _InOutItCat, _Range_checked_iterator_tag) + { // transform [_First, _Last) with _Func + _DEBUG_RANGE(_First, _Last); + _DEBUG_POINTER(_Dest); + _DEBUG_POINTER(_Func); + for (; _First != _Last; ++_First, ++_Dest) + *_Dest = _Func(*_First); + return (_Dest); + } + +#if _SECURE_SCL +template<class _InIt, class _OutIt, class _Fn1> +inline + _OutIt _Transform(_InIt _First, _InIt _Last, _OutIt _Dest, _Fn1 _Func, + random_access_iterator_tag, _Range_checked_iterator_tag) + { // transform [_First, _Last) with _Func + // for range checked iterators, this will make sure there is enough space + _OutIt _Result = _Dest + (_Last - _First); + _Transform(_First, _Last, _CHECKED_BASE(_Dest), _Func, + forward_iterator_tag(), _Range_checked_iterator_tag()); + return (_Result); + } +#endif + +#if _SECURE_SCL + +template<class _InIt, class _OutIt, class _Fn1> +inline +_IF_CHK(_OutIt) transform(_InIt _First, _InIt _Last, _OutIt _Dest, _Fn1 _Func) + { + return _Transform(_CHECKED_BASE(_First), _CHECKED_BASE(_Last), _Dest, _Func, + _Iter_random(_First, _Dest), _STD _Range_checked_iterator_tag()); + } + +template<class _InIt, class _OutElem, class _Fn1, size_t _Size> +inline +_OutElem* transform(_InIt _First, _InIt _Last, _OutElem (&_Dest)[_Size], _Fn1 _Func) + { + return (transform(_First, _Last, + _STDEXT make_checked_array_iterator(_Dest, _Size), _Func).base()); + } + +template<class _InIt, class _OutIt, class _Fn1> +inline +_SCL_INSECURE_DEPRECATE +_IF_NOT_CHK(_OutIt) transform(_InIt _First, _InIt _Last, _OutIt _Dest, _Fn1 _Func) + { + return _Transform(_CHECKED_BASE(_First), _CHECKED_BASE(_Last), _Dest, _Func, + _Iter_random(_First, _Dest), _STD _Range_checked_iterator_tag()); + } + +#else + +template<class _InIt, class _OutIt, class _Fn1> +inline + _OutIt transform(_InIt _First, _InIt _Last, _OutIt _Dest, _Fn1 _Func) + { + return _Transform(_CHECKED_BASE(_First), _CHECKED_BASE(_Last), _Dest, _Func, + _Iter_random(_First, _Dest), _STD _Range_checked_iterator_tag()); + } + +#endif + + // TEMPLATE FUNCTION transform WITH BINARY OP +template<class _InIt1, class _InIt2, class _OutIt, class _Fn2, class _InItCats, class _InOutItCat> +inline + _OutIt _Transform(_InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, + _OutIt _Dest, _Fn2 _Func, + _InItCats, _InOutItCat, + _Range_checked_iterator_tag, _Range_checked_iterator_tag) + { // transform [_First1, _Last1) and [_First2, _Last2) with _Func + _DEBUG_RANGE(_First1, _Last1); + _DEBUG_POINTER(_Dest); + _DEBUG_POINTER(_Func); + for (; _First1 != _Last1; ++_First1, ++_First2, ++_Dest) + *_Dest = _Func(*_First1, *_First2); + return (_Dest); + } + +#if _SECURE_SCL +template<class _InIt1, class _InIt2, class _OutIt, class _Fn2> +inline + _OutIt _Transform(_InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, + _OutIt _Dest, _Fn2 _Func, + random_access_iterator_tag, random_access_iterator_tag, + _Range_checked_iterator_tag, _Range_checked_iterator_tag) + { // transform [_First1, _Last1) and [_First2, _Last2) with _Func + // for range checked iterators, this will make sure there is enough space + _InIt2 _Last2 = _First2 + (_Last1 - _First1); (_Last2); + _OutIt _Result = _Dest + (_Last1 - _First1); + _Transform(_First1, _Last1, _CHECKED_BASE(_First2), + _CHECKED_BASE(_Dest), _Func, + forward_iterator_tag(), forward_iterator_tag(), + _Range_checked_iterator_tag(), _Range_checked_iterator_tag()); + return _Result; + } + +template<class _InIt1, class _InIt2, class _OutIt, class _Fn2, class _InOutItCat> +inline + _OutIt _Transform(_InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, + _OutIt _Dest, _Fn2 _Func, + random_access_iterator_tag, _InOutItCat, + _Range_checked_iterator_tag, _Range_checked_iterator_tag) + { // transform [_First1, _Last1) and [_First2, _Last2) with _Func + // for range checked iterators, this will make sure there is enough space + _InIt2 _Last2 = _First2 + (_Last1 - _First1); (_Last2); + return _Transform(_First1, _Last1, _CHECKED_BASE(_First2), + _Dest, _Func, + forward_iterator_tag(), forward_iterator_tag(), + _Range_checked_iterator_tag(), _Range_checked_iterator_tag()); + } + +template<class _InIt1, class _InIt2, class _OutIt, class _Fn2, class _InItCats> +inline + _OutIt _Transform(_InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, + _OutIt _Dest, _Fn2 _Func, + _InItCats, random_access_iterator_tag, + _Range_checked_iterator_tag, _Range_checked_iterator_tag) + { // transform [_First1, _Last1) and [_First2, _Last2) with _Func + // for range checked iterators, this will make sure there is enough space + _OutIt _Result = _Dest + (_Last1 - _First1); + _Transform(_First1, _Last1, _First2, + _CHECKED_BASE(_Dest), _Func, + forward_iterator_tag(), forward_iterator_tag(), + _Range_checked_iterator_tag(), _Range_checked_iterator_tag()); + return _Result; + } +#endif + +#if _SECURE_SCL + +template<class _InIt1, class _InIt2, class _OutIt, class _Fn2> +inline +_IF_CHK2_(_InIt2, _OutIt, _OutIt) transform(_InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, + _OutIt _Dest, _Fn2 _Func) + { + return _Transform(_CHECKED_BASE(_First1), _CHECKED_BASE(_Last1), _First2, _Dest, _Func, + _Iter_random(_First1, _First2), _Iter_random(_First1, _Dest), + _STD _Range_checked_iterator_tag(), _STD _Range_checked_iterator_tag()); + } + +template<class _InIt1, class _InElem2, class _OutElem, class _Fn2, size_t _SizeFirst2, size_t _SizeDest> +inline +_OutElem* transform(_InIt1 _First1, _InIt1 _Last1, _InElem2 (&_First2)[_SizeFirst2], + _OutElem (&_Dest)[_SizeDest], _Fn2 _Func) + { + return (transform(_First1, _Last1, + _STDEXT make_checked_array_iterator(_First2, _SizeFirst2), + _STDEXT make_checked_array_iterator(_Dest, _SizeDest), + _Func).base()); + } + +template<class _InIt1, class _InIt2, class _OutElem, class _Fn2, size_t _SizeDest> +inline +_IF_CHK_(_InIt2, _OutElem*) transform(_InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, + _OutElem (&_Dest)[_SizeDest], _Fn2 _Func) + { + return (_Transform(_CHECKED_BASE(_First1), _CHECKED_BASE(_Last1), _First2, + _STDEXT make_checked_array_iterator(_Dest, _SizeDest), _Func, + _Iter_random(_First1, _First2), _Iter_cat(_First1), + _STD _Range_checked_iterator_tag(), _STD _Range_checked_iterator_tag()).base()); + } + +template<class _InIt1, class _InIt2, class _OutElem, class _Fn2, size_t _SizeDest> +inline +_SCL_INSECURE_DEPRECATE +_IF_NOT_CHK_(_InIt2, _OutElem*) transform(_InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, + _OutElem (&_Dest)[_SizeDest], _Fn2 _Func) + { + return (_Transform(_CHECKED_BASE(_First1), _CHECKED_BASE(_Last1), _First2, + _STDEXT make_checked_array_iterator(_Dest, _SizeDest), _Func, + _Iter_random(_First1, _First2), _Iter_cat(_First1), + _STD _Range_checked_iterator_tag(), _STD _Range_checked_iterator_tag()).base()); + } + +template<class _InIt1, class _InElem2, class _OutIt, class _Fn2, size_t _SizeFirst2> +inline +_IF_CHK(_OutIt) transform(_InIt1 _First1, _InIt1 _Last1, _InElem2 (&_First2)[_SizeFirst2], + _OutIt _Dest, _Fn2 _Func) + { + return (_Transform(_CHECKED_BASE(_First1), _CHECKED_BASE(_Last1), + _STDEXT make_checked_array_iterator(_First2, _SizeFirst2), + _Dest, _Func, + _Iter_cat(_First1), _Iter_random(_First1, _Dest), + _STD _Range_checked_iterator_tag(), _STD _Range_checked_iterator_tag())); + } + +template<class _InIt1, class _InElem2, class _OutIt, class _Fn2, size_t _SizeFirst2> +inline +_SCL_INSECURE_DEPRECATE +_IF_NOT_CHK(_OutIt) transform(_InIt1 _First1, _InIt1 _Last1, _InElem2 (&_First2)[_SizeFirst2], + _OutIt _Dest, _Fn2 _Func) + { + return (_Transform(_CHECKED_BASE(_First1), _CHECKED_BASE(_Last1), + _STDEXT make_checked_array_iterator(_First2, _SizeFirst2), + _Dest, _Func, + _Iter_cat(_First1), _Iter_random(_First1, _Dest), + _STD _Range_checked_iterator_tag(), _STD _Range_checked_iterator_tag())); + } + +template<class _InIt1, class _InIt2, class _OutIt, class _Fn2> +inline +_SCL_INSECURE_DEPRECATE +_IF_NOT_CHK2_(_InIt2, _OutIt, _OutIt) transform(_InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, + _OutIt _Dest, _Fn2 _Func) + { + return _Transform(_CHECKED_BASE(_First1), _CHECKED_BASE(_Last1), _First2, _Dest, _Func, + _Iter_random(_First1, _First2), _Iter_random(_First1, _Dest), + _STD _Range_checked_iterator_tag(), _STD _Range_checked_iterator_tag()); + } + +#else + +template<class _InIt1, class _InIt2, class _OutIt, class _Fn2> +inline + _OutIt transform(_InIt1 _First1, _InIt1 _Last1, _InIt2 _First2, + _OutIt _Dest, _Fn2 _Func) + { + return _Transform(_CHECKED_BASE(_First1), _CHECKED_BASE(_Last1), _First2, _Dest, _Func, + _Iter_random(_First1, _First2), _Iter_random(_First1, _Dest), + _STD _Range_checked_iterator_tag(), _STD _Range_checked_iterator_tag()); + } + +#endif + + // TEMPLATE FUNCTION replace +template<class _FwdIt, + class _Ty> inline + void _Replace(_FwdIt _First, _FwdIt _Last, + const _Ty& _Oldval, const _Ty& _Newval) + { // replace each matching _Oldval with _Newval + _DEBUG_RANGE(_First, _Last); + for (; _First != _Last; ++_First) + if (*_First == _Oldval) + *_First = _Newval; + } + +template<class _FwdIt, + class _Ty> inline + void replace(_FwdIt _First, _FwdIt _Last, + const _Ty& _Oldval, const _Ty& _Newval) + { // replace each matching _Oldval with _Newval + _Replace(_CHECKED_BASE(_First), _CHECKED_BASE(_Last), _Oldval, _Newval); + } + + // TEMPLATE FUNCTION replace_if +template<class _FwdIt, + class _Pr, + class _Ty> inline + void _Replace_if(_FwdIt _First, _FwdIt _Last, _Pr _Pred, const _Ty& _Val) + { // replace each satisfying _Pred with _Val + _DEBUG_RANGE(_First, _Last); + _DEBUG_POINTER(_Pred); + for (; _First != _Last; ++_First) + if (_Pred(*_First)) + *_First = _Val; + } + +template<class _FwdIt, + class _Pr, + class _Ty> inline + void replace_if(_FwdIt _First, _FwdIt _Last, _Pr _Pred, const _Ty& _Val) + { // replace each satisfying _Pred with _Val + _Replace_if(_CHECKED_BASE(_First), _CHECKED_BASE(_Last), _Pred, _Val); + } + + // TEMPLATE FUNCTION replace_copy +template<class _InIt, class _OutIt, class _Ty, class _InOutItCat> +inline + _OutIt _Replace_copy(_InIt _First, _InIt _Last, _OutIt _Dest, + const _Ty& _Oldval, const _Ty& _Newval, + _InOutItCat, _Range_checked_iterator_tag) + { // copy replacing each matching _Oldval with _Newval + _DEBUG_RANGE(_First, _Last); + _DEBUG_POINTER(_Dest); + for (; _First != _Last; ++_First, ++_Dest) + *_Dest = *_First == _Oldval ? _Newval : *_First; + return (_Dest); + } + +#if _SECURE_SCL +template<class _InIt, class _OutIt, class _Ty> +inline + _OutIt _Replace_copy(_InIt _First, _InIt _Last, _OutIt _Dest, + const _Ty& _Oldval, const _Ty& _Newval, + random_access_iterator_tag, _Range_checked_iterator_tag) + { // copy replacing each matching _Oldval with _Newval + // for range checked iterators, this will make sure there is enough space + _OutIt _Result = _Dest + (_Last - _First); + _Replace_copy(_First, _Last, _CHECKED_BASE(_Dest), + _Oldval, _Newval, + forward_iterator_tag(), _Range_checked_iterator_tag()); + return (_Result); + } +#endif + +#if _SECURE_SCL + +template<class _InIt, + class _OutIt, + class _Ty> inline +_IF_CHK(_OutIt) replace_copy(_InIt _First, _InIt _Last, _OutIt _Dest, + const _Ty& _Oldval, const _Ty& _Newval) + { // copy replacing each matching _Oldval with _Newval + return _Replace_copy(_CHECKED_BASE(_First), _CHECKED_BASE(_Last), _Dest, _Oldval, _Newval, + _Iter_r... [truncated message content] |