raysan5 / rres

A simple and easy-to-use file-format to package resources
MIT License
391 stars 34 forks source link

C++ compilation requires the -fpermissive flag set #18

Closed viseztrance closed 1 year ago

viseztrance commented 1 year ago

Compilation in C++ fails unless the -fpermissive flag is set. Standalone raylib works without this flag so it would be nice for rres to do the same.

/home/daniel/Projects/sigma/vendor/rres/src/rres.h: In function ‘rresCentralDir rresLoadCentralDirectory(const char*)’:
/home/daniel/Projects/sigma/vendor/rres/src/rres.h:894:52: error: invalid conversion from ‘void*’ to ‘unsigned char*’ [-fpermissive]
  894 |                     unsigned char *ptr = chunkData.raw;
      |                                          ~~~~~~~~~~^~~
      |                                                    |
      |                                                    void*
/home/daniel/Projects/sigma/vendor/rres/src/rres.h: In function ‘rresResourceChunkData rresLoadResourceChunkData(rresResourceChunkInfo, void*)’:
/home/daniel/Projects/sigma/vendor/rres/src/rres.h:1057:43: error: invalid conversion from ‘void*’ to ‘unsigned char*’ [-fpermissive]
 1057 |     unsigned int crc32 = rresComputeCRC32(data, info.packedSize);
      |                                           ^~~~
      |                                           |
      |                                           void*
... many more errors
raysan5 commented 1 year ago

@viseztrance Thanks for reporting, I will review it as soon as possible.

raysan5 commented 1 year ago

@viseztrance Can you try just casting to (unsigned char *)? It should solve it, afaik.