Convert app to c++
This commit is contained in:
parent
069f8c8465
commit
c35b33b613
8 changed files with 64 additions and 16 deletions
|
@ -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
|
|
@ -1,3 +1,11 @@
|
|||
#pragma once
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void lib2_function(); // Function declaration for lib2
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue