diff --git a/examples/example01_instance_info.cpp b/examples/example01_instance_info.cpp index 97549a6..aa32b28 100644 --- a/examples/example01_instance_info.cpp +++ b/examples/example01_instance_info.cpp @@ -15,7 +15,11 @@ // Print information about an instance (/api/v1/instance). -#include "mastodonpp.hpp" +#if __has_include("mastodonpp.hpp") +# include "mastodonpp.hpp" // We're building mastodonpp. +#else +# include // We're building outside mastodonpp. +#endif #include #include diff --git a/examples/example02_streaming.cpp b/examples/example02_streaming.cpp index 4a24b3c..748e5f8 100644 --- a/examples/example02_streaming.cpp +++ b/examples/example02_streaming.cpp @@ -15,7 +15,11 @@ // Print new public events (/api/v1/streaming/public). -#include "mastodonpp.hpp" +#if __has_include("mastodonpp.hpp") +# include "mastodonpp.hpp" // We're building mastodonpp. +#else +# include // We're building outside mastodonpp. +#endif #include #include diff --git a/examples/example03_post_status.cpp b/examples/example03_post_status.cpp index 62fc919..bdf88dc 100644 --- a/examples/example03_post_status.cpp +++ b/examples/example03_post_status.cpp @@ -15,7 +15,11 @@ // Post a status (/api/v1/status). -#include "mastodonpp.hpp" +#if __has_include("mastodonpp.hpp") +# include "mastodonpp.hpp" // We're building mastodonpp. +#else +# include // We're building outside mastodonpp. +#endif #include #include diff --git a/examples/example04_post_with_attachment.cpp b/examples/example04_post_with_attachment.cpp index f40170f..2f8b3db 100644 --- a/examples/example04_post_with_attachment.cpp +++ b/examples/example04_post_with_attachment.cpp @@ -15,7 +15,11 @@ // Post a status (/api/v1/status) with an attachment (/api/v1/media). -#include "mastodonpp.hpp" +#if __has_include("mastodonpp.hpp") +# include "mastodonpp.hpp" // We're building mastodonpp. +#else +# include // We're building outside mastodonpp. +#endif #include #include diff --git a/examples/example05_update_notification_settings.cpp b/examples/example05_update_notification_settings.cpp index 5690265..f4c1fca 100644 --- a/examples/example05_update_notification_settings.cpp +++ b/examples/example05_update_notification_settings.cpp @@ -15,7 +15,11 @@ // Update notification settings (/api/pleroma/notification_settings). -#include "mastodonpp.hpp" +#if __has_include("mastodonpp.hpp") +# include "mastodonpp.hpp" // We're building mastodonpp. +#else +# include // We're building outside mastodonpp. +#endif #include #include diff --git a/examples/example06_update_name.cpp b/examples/example06_update_name.cpp index 5232362..2db1a95 100644 --- a/examples/example06_update_name.cpp +++ b/examples/example06_update_name.cpp @@ -15,7 +15,11 @@ // Update account display name settings (/api/v1/accounts/update_credentials). -#include "mastodonpp.hpp" +#if __has_include("mastodonpp.hpp") +# include "mastodonpp.hpp" // We're building mastodonpp. +#else +# include // We're building outside mastodonpp. +#endif #include #include diff --git a/examples/example07_delete_status.cpp b/examples/example07_delete_status.cpp index fc333b5..864ba9f 100644 --- a/examples/example07_delete_status.cpp +++ b/examples/example07_delete_status.cpp @@ -15,7 +15,11 @@ // Post a status (/api/v1/status), then delete it (/api/v1/statuses/:id). -#include "mastodonpp.hpp" +#if __has_include("mastodonpp.hpp") +# include "mastodonpp.hpp" // We're building mastodonpp. +#else +# include // We're building outside mastodonpp. +#endif #include #include diff --git a/examples/example08_obtain_token.cpp b/examples/example08_obtain_token.cpp index 5a072a6..82ac39a 100644 --- a/examples/example08_obtain_token.cpp +++ b/examples/example08_obtain_token.cpp @@ -15,7 +15,11 @@ // Obtain an access token and verify that it works. -#include "mastodonpp.hpp" +#if __has_include("mastodonpp.hpp") +# include "mastodonpp.hpp" // We're building mastodonpp. +#else +# include // We're building outside mastodonpp. +#endif #include #include