Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed compile error. Added block to case label. #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Red-Portal
Copy link

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;
         ^~~~

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

```shell
-------------------------------------------------
- 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;
         ^~~~
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant