Skip to content

Add stdint.h to utf8 extension#6

Open
bobf wants to merge 2 commits intoicedman:mainfrom
bobf:main
Open

Add stdint.h to utf8 extension#6
bobf wants to merge 2 commits intoicedman:mainfrom
bobf:main

Conversation

@bobf
Copy link

@bobf bobf commented Mar 9, 2024

I don't know C++ but this made your plugin work for me, feel free to adjust/ignore if I'm doing something wrong, but either way thank you for the plugin, it seems to be working great. 🙏

Fixes failure:

[ 94%] Building CXX object CMakeFiles/textmate.dir/libs/tm-parser/textmate/extensions/utf8.cpp.o
In file included from /home/bob/dev/nvim-textmate/libs/tm-parser/textmate/extensions/utf8.cpp:1:
/home/bob/dev/nvim-textmate/libs/tm-parser/textmate/extensions/utf8.h:8:23: error: ‘uint32_t’ was not declared in this scope
    8 | int codepoint_to_utf8(uint32_t utf, char* out);
      |                       ^~~~~~~~
/home/bob/dev/nvim-textmate/libs/tm-parser/textmate/extensions/utf8.h:5:1: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
    4 | #include <string>
  +++ |+#include <cstdint>
    5 | // #include <stdint.h>
/home/bob/dev/nvim-textmate/libs/tm-parser/textmate/extensions/utf8.h:8:37: error: expected primary-expression before ‘char’
    8 | int codepoint_to_utf8(uint32_t utf, char* out);
      |                                     ^~~~
/home/bob/dev/nvim-textmate/libs/tm-parser/textmate/extensions/utf8.h:8:46: error: expression list treated as compound expression in initializer [-fpermissive]
    8 | int codepoint_to_utf8(uint32_t utf, char* out);
      |                                              ^
/home/bob/dev/nvim-textmate/libs/tm-parser/textmate/extensions/utf8.cpp:34:5: error: redefinition of ‘int codepoint_to_utf8’
   34 | int codepoint_to_utf8(uint32_t utf, char* out)
      |     ^~~~~~~~~~~~~~~~~
/home/bob/dev/nvim-textmate/libs/tm-parser/textmate/extensions/utf8.h:8:5: note: ‘int codepoint_to_utf8’ previously defined here
    8 | int codepoint_to_utf8(uint32_t utf, char* out);
      |     ^~~~~~~~~~~~~~~~~
/home/bob/dev/nvim-textmate/libs/tm-parser/textmate/extensions/utf8.cpp:34:23: error: ‘uint32_t’ was not declared in this scope
   34 | int codepoint_to_utf8(uint32_t utf, char* out)
      |                       ^~~~~~~~
/home/bob/dev/nvim-textmate/libs/tm-parser/textmate/extensions/utf8.cpp:2:1: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
    1 | #include "utf8.h"
  +++ |+#include <cstdint>
    2 |
/home/bob/dev/nvim-textmate/libs/tm-parser/textmate/extensions/utf8.cpp:34:37: error: expected primary-expression before ‘char’
   34 | int codepoint_to_utf8(uint32_t utf, char* out)
      |                                     ^~~~
/home/bob/dev/nvim-textmate/libs/tm-parser/textmate/extensions/utf8.cpp: In function ‘std::string wstring_to_utf8string(std::wstring)’:
/home/bob/dev/nvim-textmate/libs/tm-parser/textmate/extensions/utf8.cpp:77:26: error: ‘codepoint_to_utf8’ cannot be used as a function
   77 |         codepoint_to_utf8(c, (char*)tmp);
      |         ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
make[3]: *** [CMakeFiles/textmate.dir/build.make:272: CMakeFiles/textmate.dir/libs/tm-parser/textmate/extensions/utf8.cpp.o] Error 1
make[2]: *** [CMakeFiles/Makefile2:111: CMakeFiles/textmate.dir/all] Error 2
make[1]: *** [Makefile:91: all] Error 2
make[1]: Leaving directory '/home/bob/dev/nvim-textmate/build'
make: *** [Makefile:11: build] Error 2

bobf and others added 2 commits March 9, 2024 21:00
Fixes failure:

```
[ 94%] Building CXX object CMakeFiles/textmate.dir/libs/tm-parser/textmate/extensions/utf8.cpp.o
In file included from /home/bob/dev/nvim-textmate/libs/tm-parser/textmate/extensions/utf8.cpp:1:
/home/bob/dev/nvim-textmate/libs/tm-parser/textmate/extensions/utf8.h:8:23: error: ‘uint32_t’ was not declared in this scope
    8 | int codepoint_to_utf8(uint32_t utf, char* out);
      |                       ^~~~~~~~
/home/bob/dev/nvim-textmate/libs/tm-parser/textmate/extensions/utf8.h:5:1: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
    4 | #include <string>
  +++ |+#include <cstdint>
    5 | // #include <stdint.h>
/home/bob/dev/nvim-textmate/libs/tm-parser/textmate/extensions/utf8.h:8:37: error: expected primary-expression before ‘char’
    8 | int codepoint_to_utf8(uint32_t utf, char* out);
      |                                     ^~~~
/home/bob/dev/nvim-textmate/libs/tm-parser/textmate/extensions/utf8.h:8:46: error: expression list treated as compound expression in initializer [-fpermissive]
    8 | int codepoint_to_utf8(uint32_t utf, char* out);
      |                                              ^
/home/bob/dev/nvim-textmate/libs/tm-parser/textmate/extensions/utf8.cpp:34:5: error: redefinition of ‘int codepoint_to_utf8’
   34 | int codepoint_to_utf8(uint32_t utf, char* out)
      |     ^~~~~~~~~~~~~~~~~
/home/bob/dev/nvim-textmate/libs/tm-parser/textmate/extensions/utf8.h:8:5: note: ‘int codepoint_to_utf8’ previously defined here
    8 | int codepoint_to_utf8(uint32_t utf, char* out);
      |     ^~~~~~~~~~~~~~~~~
/home/bob/dev/nvim-textmate/libs/tm-parser/textmate/extensions/utf8.cpp:34:23: error: ‘uint32_t’ was not declared in this scope
   34 | int codepoint_to_utf8(uint32_t utf, char* out)
      |                       ^~~~~~~~
/home/bob/dev/nvim-textmate/libs/tm-parser/textmate/extensions/utf8.cpp:2:1: note: ‘uint32_t’ is defined in header ‘<cstdint>’; did you forget to ‘#include <cstdint>’?
    1 | #include "utf8.h"
  +++ |+#include <cstdint>
    2 |
/home/bob/dev/nvim-textmate/libs/tm-parser/textmate/extensions/utf8.cpp:34:37: error: expected primary-expression before ‘char’
   34 | int codepoint_to_utf8(uint32_t utf, char* out)
      |                                     ^~~~
/home/bob/dev/nvim-textmate/libs/tm-parser/textmate/extensions/utf8.cpp: In function ‘std::string wstring_to_utf8string(std::wstring)’:
/home/bob/dev/nvim-textmate/libs/tm-parser/textmate/extensions/utf8.cpp:77:26: error: ‘codepoint_to_utf8’ cannot be used as a function
   77 |         codepoint_to_utf8(c, (char*)tmp);
      |         ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
make[3]: *** [CMakeFiles/textmate.dir/build.make:272: CMakeFiles/textmate.dir/libs/tm-parser/textmate/extensions/utf8.cpp.o] Error 1
make[2]: *** [CMakeFiles/Makefile2:111: CMakeFiles/textmate.dir/all] Error 2
make[1]: *** [Makefile:91: all] Error 2
make[1]: Leaving directory '/home/bob/dev/nvim-textmate/build'
make: *** [Makefile:11: build] Error 2
```
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.

2 participants