Skip to content

Commit

Permalink
add extern "C" to avoid linker errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
m1maker committed Feb 22, 2025
1 parent 97e927d commit afe1881
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Dep/utf-8.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/

#ifdef __cplusplus
extern "C" {
#endif


#include "utf-8.h"

#include <string.h>
Expand Down Expand Up @@ -285,3 +290,8 @@ const char* unicode_converter(uint32_t codepoint, uint8_t size) {

return str;
}

#ifdef __cplusplus
} // extern "C"
#endif

10 changes: 10 additions & 0 deletions Dep/utf-8.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ SOFTWARE.
#ifndef utf8_iter_H
#define utf8_iter_H

#ifdef __cplusplus
extern "C" {
#endif


#include <stdint.h>

typedef struct utf8_iter {
Expand Down Expand Up @@ -61,4 +66,9 @@ uint8_t unicode_charsize (uint32_t codepoint); // calculates the number of byt
uint32_t utf8_converter (const char* character, uint8_t size);
const char* unicode_converter (uint32_t codepoint, uint8_t size);

#ifdef __cplusplus
} // extern "C"
#endif


#endif

0 comments on commit afe1881

Please sign in to comment.