Skip to content

Commit

Permalink
All compiling with -std=c++0x on Teensy 3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulStoffregen committed Jan 30, 2016
1 parent af8ebb0 commit 96c8a91
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions teensy3/Print.cpp
Expand Up @@ -88,14 +88,22 @@ int Print::printf(const char *format, ...)
{
va_list ap;
va_start(ap, format);
#ifdef __STRICT_ANSI__
return 0; // TODO: make this work with -std=c++0x
#else
return vdprintf((int)this, format, ap);
#endif

This comment has been minimized.

Copy link
@Trass3r

Trass3r Jan 30, 2016

For me just adding the declaration worked.
extern "C" int vdprintf(int fd, const char* format, va_list ap);

This comment has been minimized.

Copy link
@PaulStoffregen

PaulStoffregen Jan 30, 2016

Author Owner

If you put Serial.printf("test"); anywhere in your program, does that end up giving you a compile error where vdprintf isn't found?

This comment has been minimized.

Copy link
@Trass3r

Trass3r Jan 30, 2016

Now that you mention it I guess I've never actually used the function. Might give linker errors.

}

int Print::printf(const __FlashStringHelper *format, ...)
{
va_list ap;
va_start(ap, format);
#ifdef __STRICT_ANSI__
return 0;
#else
return vdprintf((int)this, (const char *)format, ap);
#endif
}

#ifdef __MKL26Z64__
Expand Down

0 comments on commit 96c8a91

Please sign in to comment.