An ugly diff

Recently, I came across a breakage in editors/emacs-devel port (FreeBSD, ofcourse) on SPARC64 architecture caused by having a struct frame defined in both FreeBSD header machine/frame.h (on Sparc) and Emacs header src/frame.h. To fix it, I renamed frame before it gets defined by FreeBSD header files:

++#ifdef __sparc__ 
++#define frame freebsd_sparc_frame
 +#include <sys/user.h>
-+#include <sys/resource.h>
++#ifdef __sparc__ 
++#undef frame

So ugly, wish we had namespaces in C 🙁

P.S. Thanks to tabthorpe (mentor) for his Sparc64 tinderbox 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

Anti-Spam Quiz: