Punity icon indicating copy to clipboard operation
Punity copied to clipboard

Fixed compile error. Added block to case label.

Open Red-Portal opened this issue 7 years ago • 0 comments

On mingw, a variable declaration in a case label needs to be in a separate block.

I added a block for the label.

-------------------------------------------------
- Compiler:      gcc
- Configuration: debug
- Runtime:       PUN_RUNTIME_WINDOWS
- Target C:      example-platformer
- Target RC:     example-platformer.rc
- Output:        bin\example-platformer.exe
-------------------------------------------------

Building resources...

Compiling...
Building debug...
In file included from ./lib/punity-tiled.h:139:0,
                 from example-platformer.c:19:
./lib/json.h: In function 'new_value':
./lib/json.h:258:42: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
                   (state, values_size + ((unsigned long) value->object.values), 0)) )
                                          ^
In file included from example-platformer.c:19:0:
./lib/punity-tiled.h: In function 'tiled_load_meta_':
./lib/punity-tiled.h:272:9: error: a label can only be part of a statement and a declaration is not a statement
         Tile *tile = (Tile*)data;
         ^~~~

Red-Portal avatar Jun 29 '17 11:06 Red-Portal