Convert app to c++

This commit is contained in:
Attila Body 2025-07-03 19:12:18 +02:00
parent 069f8c8465
commit c35b33b613
Signed by: abody
GPG key ID: BD0C6214E68FB5CF
8 changed files with 64 additions and 16 deletions

View file

@ -3,4 +3,12 @@
// are part of lib1.h's public interface. For simple calls in lib1.c,
// including in lib1.c is sufficient.
#if defined(__cplusplus)
extern "C" {
#endif
void lib1_function();
#if defined(__cplusplus)
}
#endif

View file

@ -1,3 +1,11 @@
#pragma once
#if defined(__cplusplus)
extern "C" {
#endif
void lib2_function(); // Function declaration for lib2
#if defined(__cplusplus)
}
#endif

View file

@ -1,6 +1,10 @@
#pragma once
#include <stdio.h> // Standard I/O header is needed here because printf is used within this header-only function.
#if defined(__cplusplus)
extern "C" {
#endif
// Declared as static to prevent multiple definition errors.
// Since this is a header-only function, it will be included and compiled
// into every translation unit that includes lib3.h. 'static' limits its
@ -9,3 +13,7 @@ static void lib3_function()
{
printf("This is a function from Header-Only Library 3.\n");
}
#if defined(__cplusplus)
}
#endif