most esoteric fix ever for clang

This commit is contained in:
espie 2017-05-14 12:02:03 +00:00
parent a412e99e71
commit 775360f2a2
2 changed files with 34 additions and 5 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.7 2015/09/23 09:41:18 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.8 2017/05/14 12:02:03 espie Exp $
COMMENT = free multi-dimensional Tetris-like game
DISTNAME = galois-0.4
@ -15,16 +15,14 @@ WANTLIB += Xrandr Xrender atk-1.0 atkmm-1.6 c cairo cairomm-1.0
WANTLIB += fontconfig freetype gdk-x11-2.0 gdk_pixbuf-2.0 gdkmm-2.4
WANTLIB += gio-2.0 giomm-2.4 glib-2.0 glibmm-2.4 gobject-2.0 gtk-x11-2.0
WANTLIB += gtkmm-2.4 m pango-1.0 pangocairo-1.0 pangoft2-1.0
WANTLIB += pangomm-1.4 pthread sigc-2.0 xml++-2.6 xml2 z
WANTLIB += pangomm-1.4 pthread sigc-2.0 xml++-2.6 xml2 z ${LIBECXX}
MASTER_SITES = ${MASTER_SITE_SAVANNAH:=galois/source/}
MODULES = devel/gettext
# c++11
MODULES += gcc4
MODGCC4_ARCHS= *
MODGCC4_LANGS= c++
WANT_CXX = base gcc
LIB_DEPENDS = textproc/libxml++>=2.40.0 \
x11/gtk2mm

View File

@ -0,0 +1,31 @@
$OpenBSD: patch-src_grid_h,v 1.1 2017/05/14 12:02:03 espie Exp $
assigning a slice to a gslice is a gnu extension actually
turns out the non working code does work in both clang and eg++
Index: src/grid.h
--- src/grid.h.orig
+++ src/grid.h
@@ -126,10 +126,11 @@ template <class T> void grid<T>::add(const coords &c,
size_t len[] = { size_t(rows), size_t(cols), size_t(layers), };
size_t str[] = { size_t(ncols), 1, size_t(ncols * nrows), };
// doesn't work?
- // std::gslice g(d0.x + ncols * (d0.y + nrows * d0.z),
- // std::valarray<size_t>(len, 3),
- // std::valarray<size_t>(str, 3));
- // mask[g] = m;
+ std::gslice g(d0.x + ncols * (d0.y + nrows * d0.z),
+ std::valarray<size_t>(len, 3),
+ std::valarray<size_t>(str, 3));
+ mask[g] = m;
+#if 0
for (int i=0; i<layers; ++i)
{
std::gslice g(d0.x + ncols * (d0.y + nrows * (d0.z + i)),
@@ -138,6 +139,7 @@ template <class T> void grid<T>::add(const coords &c,
std::slice s(cols * rows * i, cols * rows, 1);
mask[g] = m[s];
}
+#endif
c0 = n0;
rows = nrows;