Not much movement on this really, it's one of those things where if you want/need it then you'll need to add it yourself or contact one of the C++ guys specifically, I remember spiller did a lot of C++ stuff way back.
Exceptions can be done in a similar way in C using setjmp, an example of that is:
exc.h:
#ifndef __exc_h__
#define __exc_h__
#include <noreturn.h>
#include <setjmp.h>
#ifdef __cplusplus
extern "C" {
#endif
#define try if(setjmp(*_try()) == 0)
#define catch(exc) else if(_catch(&exc))
extern jmp_buf* _try();
extern int _catch(void* exc);
extern noreturn void throw(void* exc);
#ifdef __cplusplus
}
#endif
#endif
exc.c:
#include <stdlib.h>
#include <stdio.h>
#include <setjmp.h>
typedef struct {
jmp_buf env;
void* ret;
void* next;
} _exc_t;
static _exc_t* _exc_stack = NULL;
jmp_buf* _try() {
_exc_t* ctx = (_exc_t*)malloc(sizeof(_exc_t));
if(ctx == NULL) {
fprintf(stderr, "Error: Failed to allocate context.");
abort();
}
ctx->next = _exc_stack;
_exc_stack = ctx;
return &ctx->env;
}
int _catch(void** exc) {
if(_exc_stack == NULL) {
fprintf(stderr, "Error: Context stack empty.");
return 0;
}
_exc_t ctx = *_exc_stack;
free(_exc_stack);
_exc_stack = ctx.next;
*exc = ctx.ret;
return 1;
}
void throw(void* exc) {
if(_exc_stack == NULL) {
fprintf(stderr, "Error: Context stack empty.");
abort();
}
_exc_stack->ret = exc;
longjmp(_exc_stack->env, 1);
}
noreturn.h:
#ifndef __noreturn_h__
#define __noreturn_h__
#if defined(__BORLANDC__) || (_MSC_VER >= 1310)
# define noreturn _declspec(noreturn)
#elif (__GNUC__ > 2) || ((__GNUC__ == 2) && (__GNUC_MINOR__ >= 5))
# define noreturn __attribute__ ((noreturn))
/*#elif (__cplusplus >= ???)
# define noreturn [[noreturn]]
#elif (__STDC_VERSION__ >= 201ymmL)
# define noreturn _Noreturn*/
#else
#define noreturn
#endif
#endif
As for iostreams I don't understand why fwrite/fprintf would be much harder.