gcode-mirror / iphone-dev

Automatically exported from code.google.com/p/iphone-dev
1 stars 0 forks source link

arm/setjmp.h missing C++ guards #131

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
When include "setjmp.h" from a C++ context the arm specific version
declares the symbols in the C++ space. And hence mangles the symbols which
causes errors at link time. The function defs need to be wrapped with
__BEGIN/END_DECLS as:

===
#ifndef _BSD_ARM_SETJMP_H_
#define _BSD_ARM_SETJMP_H_

#include <sys/cdefs.h>

#define _JBLEN  27
typedef int jmp_buf[_JBLEN];
typedef int sigjmp_buf[_JBLEN + 1];

__BEGIN_DECLS
int setjmp(jmp_buf env);
void longjmp(jmp_buf env, int val);

#ifndef _ANSI_SOURCE
int _setjmp(jmp_buf env);
void _longjmp(jmp_buf, int val);
int sigsetjmp(sigjmp_buf env, int val);
void siglongjmp(sigjmp_buf env, int val);
#endif

#if !defined(_ANSI_SOURCE) && !defined(_POSIX_C_SOURCE)
void longjmperror(void);
#endif
__END_DECLS

#endif
===

Original issue reported on code.google.com by grafi...@gmail.com on 13 Apr 2008 at 6:13