Fixed compile error. Added block to case label.#8
Open
Red-Portal wants to merge 1 commit intomartincohen:masterfrom
Open
Fixed compile error. Added block to case label.#8Red-Portal wants to merge 1 commit intomartincohen:masterfrom
Red-Portal wants to merge 1 commit intomartincohen:masterfrom
Conversation
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;
^~~~
```
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On mingw, a variable declaration in a case label needs to be in a separate block.
I added a block for the label.