Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Omit all new and delete implementation when AVR core provides it #82

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ArduinoSTL.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include "ArduinoSTL.h"
#include <ArduinoSTL.h>
#include <Arduino.h>

//
Expand Down
2 changes: 1 addition & 1 deletion src/ArduinoSTL.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#define ARDUINOSTL_M_H

#include <Arduino.h>
#include "serstream"
#include <serstream>

// Create cout and cin.. there doesn't seem to be a way
// to control what serial device at runtime. Grr.
Expand Down
6 changes: 3 additions & 3 deletions src/abi/abi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
USA.
*/

#include "cstdlib"
#include "typeinfo"
#include "basic_definitions"
#include <cstdlib>
#include <typeinfo>
#include <basic_definitions>

/* This file implements a number of the language support features
* needed to deal with the C++ abi, as originally documented in the
Expand Down
8 changes: 4 additions & 4 deletions src/algorithm
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#include "cstdlib"
#include "iterator"
#include "utility"
#include "functional"
#include <cstdlib>
#include <iterator>
#include <utility>
#include <functional>

#ifndef __STD_HEADER_ALGORITHM
#define __STD_HEADER_ALGORITHM 1
Expand Down
2 changes: 1 addition & 1 deletion src/algorithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/


#include "algorithm"
#include <algorithm>


namespace std{
Expand Down
4 changes: 2 additions & 2 deletions src/array
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#ifndef __ARRAY__
#define __ARRAY__

#include "cstddef"
#include "initializer_list"
#include <cstddef>
#include <initializer_list>

namespace std {

Expand Down
10 changes: 5 additions & 5 deletions src/associative_base
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@



#include "memory"
#include "utility"
#include "iterator"
#include "functional"
#include "list"
#include<memory>
#include<utility>
#include<iterator>
#include<functional>
#include<list>


#ifndef __STD_HEADER_ASSOCIATIVE_BASE
Expand Down
2 changes: 1 addition & 1 deletion src/associative_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

*/

#include "associative_base"
#include <associative_base>

namespace std{

Expand Down
2 changes: 1 addition & 1 deletion src/basic_definitions
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#ifndef __BASIC_DEFINITIONS
#define __BASIC_DEFINITIONS 1

#include "system_configuration.h"
#include <system_configuration.h>

#pragma GCC visibility push(default)

Expand Down
12 changes: 6 additions & 6 deletions src/bitset
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#include "basic_definitions"
#include "cstddef"
#include "climits"
#include "func_exception"
#include "string"
#include "iosfwd"
#include <basic_definitions>
#include <cstddef>
#include <climits>
#include <func_exception>
#include <string>
#include <iosfwd>

#ifndef __STD_BITSET_HEADER
#define __STD_BITSET_HEADER 1
Expand Down
2 changes: 1 addition & 1 deletion src/bitset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

*/

#include "bitset"
#include <bitset>

namespace std{

Expand Down
10 changes: 5 additions & 5 deletions src/char_traits
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#include "basic_definitions"
#include <basic_definitions>
#include <string.h>
#include "exception"
#include "memory"
#include <exception>
#include <memory>

#ifdef __UCLIBCXX_HAS_WCHAR__
#include "cwchar"
#include "cwctype"
#include <cwchar>
#include <cwctype>
#endif

#ifndef __HEADER_CHAR_TRAITS
Expand Down
4 changes: 2 additions & 2 deletions src/char_traits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
#define __UCLIBCXX_COMPILE_CHAR_TRAITS__ 1


#include "basic_definitions"
#include "char_traits"
#include <basic_definitions>
#include <char_traits>

namespace std{

Expand Down
4 changes: 2 additions & 2 deletions src/complex
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#include "istream"
#include "ostream"
#include <istream>
#include <ostream>

#ifndef __STD_HEADER_COMPLEX
#define __STD_HEADER_COMPLEX 1
Expand Down
2 changes: 1 addition & 1 deletion src/complex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#include "complex"
#include <complex>


namespace std{
Expand Down
2 changes: 1 addition & 1 deletion src/cstdio
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/

#include <stdio.h>
#include "basic_definitions"
#include <basic_definitions>

#ifndef __HEADER_CSTDIO
#define __HEADER_CSTDIO 1
Expand Down
2 changes: 1 addition & 1 deletion src/cstdlib
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

#include <stdlib.h>
#include "basic_definitions"
#include <basic_definitions>

#ifndef __HEADER_CSTDLIB
#define __HEADER_CSTDLIB 1
Expand Down
2 changes: 1 addition & 1 deletion src/cstring
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#include "cstddef"
#include <cstddef>
#include <string.h>

#ifndef __HEADER_CSTRING
Expand Down
2 changes: 1 addition & 1 deletion src/ctime
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@

#pragma GCC system_header

#include "cstddef"
#include <cstddef>

#include <time.h>

Expand Down
2 changes: 1 addition & 1 deletion src/cwchar
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
*/

#include <wchar.h>
#include "basic_definitions"
#include <basic_definitions>

#ifndef __HEADER_CWCHAR
#define __HEADER_CWCHAR 1
Expand Down
7 changes: 2 additions & 5 deletions src/del_op.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,12 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

// Arduino 1.0 contains an implementation for this.
#if ARDUINO < 100

#include <new>
#include <cstdlib>
#include <func_exception>

#if defined(USING_NEW_FROM_UCLIBC) && ARDUINO < 100
_UCXXEXPORT void operator delete(void* ptr) _UCXX_USE_NOEXCEPT{
free(ptr);
}

#endif
#endif // defined(USING_NEW_FROM_UCLIBC) && ARDUINO < 100
10 changes: 5 additions & 5 deletions src/del_opnt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#include "new"
#include "cstdlib"
#include "func_exception"
#include <new>
#include <cstdlib>
#include <func_exception>

#ifndef NO_NOTHROW
#if defined(USING_NEW_FROM_UCLIBC) && !defined(NO_NOTHROW)
_UCXXEXPORT void operator delete(void* ptr, const std::nothrow_t& ) _UCXX_USE_NOEXCEPT {
free(ptr);
}
#endif
#endif // defined(USING_NEW_FROM_UCLIBC) && !defined(NO_NOTHROW)
8 changes: 5 additions & 3 deletions src/del_ops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@
*/
/* C++14 sized deallocation */

#include "new"
#include "cstdlib"
#include "func_exception"
#include <new>
#include <cstdlib>
#include <func_exception>

#if defined(USING_NEW_FROM_UCLIBC)
_UCXXEXPORT void operator delete(void* ptr, std::size_t) _UCXX_USE_NOEXCEPT{
::operator delete (ptr);
}
#endif // defined(USING_NEW_FROM_UCLIBC)
7 changes: 2 additions & 5 deletions src/del_opv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,12 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

// Arduino 1.0 contains an implementation for this.
#if ARDUINO < 100

#if defined(USING_NEW_FROM_UCLIBC) && ARDUINO < 100
#include <new>
#include <cstdlib>
#include <func_exception>

_UCXXEXPORT void operator delete[](void * ptr) _UCXX_USE_NOEXCEPT{
free(ptr);
}

#endif
#endif // defined(USING_NEW_FROM_UCLIBC) && ARDUINO < 100
10 changes: 5 additions & 5 deletions src/del_opvnt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#include "new"
#include "cstdlib"
#include "func_exception"
#include <new>
#include <cstdlib>
#include <func_exception>

#ifndef NO_NOTHROW
#if defined(USING_NEW_FROM_UCLIBC) && !defined(NO_NOTHROW)
_UCXXEXPORT void operator delete[](void* ptr, const std::nothrow_t& ) _UCXX_USE_NOEXCEPT{
free(ptr);
}
#endif
#endif // defined(USING_NEW_FROM_UCLIBC) && !defined(NO_NOTHROW)
8 changes: 5 additions & 3 deletions src/del_opvs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@
*/
/* C++14 sized deallocation */

#include "new"
#include "cstdlib"
#include "func_exception"
#include <new>
#include <cstdlib>
#include <func_exception>

#if defined(USING_NEW_FROM_UCLIBC)
_UCXXEXPORT void operator delete[](void * ptr, std::size_t) _UCXX_USE_NOEXCEPT{
::operator delete[] (ptr);
}
#endif // defined(USING_NEW_FROM_UCLIBC)
6 changes: 3 additions & 3 deletions src/deque
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
*/


#include "memory"
#include "iterator"
#include "stdexcept"
#include <memory>
#include <iterator>
#include <stdexcept>

#pragma GCC visibility push(default)

Expand Down
2 changes: 1 addition & 1 deletion src/deque.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

*/

#include "deque"
#include <deque>


namespace std{
Expand Down
8 changes: 4 additions & 4 deletions src/eh_alloc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#include "cstdlib"
#include "cstring"
#include "func_exception"
#include <cstdlib>
#include <cstring>
#include <func_exception>

//This is a system-specific header which does all of the error-handling management
#include "unwind-cxx.h"
#include <unwind-cxx.h>

namespace __cxxabiv1
{
Expand Down
8 changes: 4 additions & 4 deletions src/eh_globals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#include "cstdlib"
#include "cstring"
#include "func_exception"
#include <cstdlib>
#include <cstring>
#include <func_exception>

//This is a system-specific header which does all of the error-handling management
#include "unwind-cxx.h"
#include <unwind-cxx.h>

//The following functionality is derived from reading of the GNU libstdc++ code and making it...simple

Expand Down
2 changes: 1 addition & 1 deletion src/exception
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#ifndef __EXCEPTION__
#define __EXCEPTION__

#include "basic_definitions"
#include <basic_definitions>

extern "C++" {

Expand Down
2 changes: 1 addition & 1 deletion src/exception.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

*/

#include "exception"
#include <exception>

//We can't do this yet because gcc is too stupid to be able to handle
//different implementations of exception class.
Expand Down
Loading