Skip to content

Commit

Permalink
Merge pull request #447 from Jafaral/clang-pragma
Browse files Browse the repository at this point in the history
fix gcc warnings by guarding clang pragma
  • Loading branch information
Jafaral authored May 27, 2024
2 parents bfe87de + 86ad446 commit 7163279
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
6 changes: 6 additions & 0 deletions src/h/rmacros.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,12 +222,18 @@
/*
* Block references that do not use (the address of) a particular field.
*/
#ifdef __clang__
#define Blk(p,u) \
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wunused-value\"") \
((((!ValidPtr(p)) || ((p)->u.title != T_ ## u)) ? \
(heaperr("invalid block",p, T_ ## u) , 1) : 1), &((p)->u)) \
_Pragma("clang diagnostic pop")
#else
#define Blk(p,u) \
((((!ValidPtr(p)) || ((p)->u.title != T_ ## u)) ? \
(heaperr("invalid block",p, T_ ## u) , 1) : 1), &((p)->u))
#endif

/*
* Block references for generic (set|table) code.
Expand Down
15 changes: 2 additions & 13 deletions uni/3d/viewer/Makefile
Original file line number Diff line number Diff line change
@@ -1,32 +1,21 @@
BASE=../../..
include $(BASE)/Makedefs.uni

UC=$(UNICON)
UFLAGS=-c -u

UFILES= u3dviewer.u world.u subwin3d.u

TARGET=u3dview

all: $(UFILES) $(TARGET)

pure:
$(MAKE) clean
$(MAKE) all

$(TARGET): $(UFILES)
$(UC) -G -o $(TARGET) $(UFILES)

# u3dview.u: u3dview.icn

%.u: %.icn
$(UC) $(UFLAGS) $<

zip:
zip lib3d.zip makefile *.icn
zip u3dviewer.zip Makefile *.icn

clean:
$(DEL) $(TARGET) $(UFILES) uniclass.dir uniclass.pag
$(RM) $(TARGET) $(UFILES) u3dviewer.zip uniclass.dir uniclass.pag



0 comments on commit 7163279

Please sign in to comment.