-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
100 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,8 @@ | ||
@_exported public import OpenGraph_SPI | ||
|
||
// Align the constant define behavior | ||
#if OPENGRAPH_RELEASE_2024 | ||
public let OPENGRAPH_RELEASE: Int32 = 2024 | ||
#elseif OPENGRAPH_RELEASE_2021 | ||
public let OPENGRAPH_RELEASE: Int32 = 2021 | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// OGVersion.c | ||
// OpenGraph | ||
|
||
#include "OGBase.h" | ||
#include "OGVersion.h" | ||
|
||
#if OPENGRAPH_RELEASE == OPENGRAPH_RELEASE_2024 | ||
const double OpenGraphVersionNumber __attribute__ ((used)) = (double)6.0; | ||
const unsigned char OpenGraphVersionString[] __attribute__ ((used)) = "@(#)PROGRAM:OpenGraph PROJECT:OpenGraph-6.0.87\n"; | ||
const uint64_t OGVersion = 0x2001e; | ||
#elif OPENGRAPH_RELEASE == OPENGRAPH_RELEASE_2021 | ||
const double OpenGraphVersionNumber __attribute__ ((used)) = (double)3.2; | ||
const unsigned char OpenGraphVersionString[] __attribute__ ((used)) = "@(#)PROGRAM:OpenGraph PROJECT:OpenGraph-3.2.1\n"; | ||
const uint64_t OGVersion = 0x20014; | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// | ||
// OGVersion.h | ||
// OpenGraph | ||
|
||
#ifndef OGVersion_h | ||
#define OGVersion_h | ||
|
||
#include "OGBase.h" | ||
|
||
#define OPENGRAPH_RELEASE_2021 2021 | ||
#define OPENGRAPH_RELEASE_2024 2024 | ||
|
||
#ifndef OPENGRAPH_RELEASE | ||
#define OPENGRAPH_RELEASE OPENGRAPH_RELEASE_2024 | ||
#endif | ||
|
||
OG_EXTERN_C_BEGIN | ||
|
||
OG_EXPORT const uint64_t OGVersion; | ||
|
||
OG_EXTERN_C_END | ||
|
||
#endif /* OGVersion_h */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
../OGVersion.h | ||
../Version/OGVersion.h |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// | ||
// VersionTests.swift | ||
// OpenGraphCompatibilityTests | ||
|
||
import Testing | ||
import Numerics | ||
|
||
struct VersionTests { | ||
@Test | ||
func versionNumber() async { | ||
await confirmation { confirm in | ||
#if OPENGRAPH_COMPATIBILITY_TEST | ||
switch Int32(ATTRIBUTEGRAPH_RELEASE) { | ||
case ATTRIBUTEGRAPH_RELEASE_2021: | ||
#expect(AGVersion == 0x20014) | ||
confirm() | ||
case ATTRIBUTEGRAPH_RELEASE_2024: | ||
#expect(AGVersion == 0x2001e) | ||
confirm() | ||
default: | ||
break | ||
} | ||
#else | ||
switch Int32(OPENGRAPH_RELEASE) { | ||
case OPENGRAPH_RELEASE_2021: | ||
#expect(OpenGraphVersionNumber.isApproximatelyEqual(to: 3.2)) | ||
#expect(OGVersion == 0x20014) | ||
confirm() | ||
case OPENGRAPH_RELEASE_2024: | ||
#expect(OpenGraphVersionNumber.isApproximatelyEqual(to: 6.0)) | ||
#expect(OGVersion == 0x2001e) | ||
confirm() | ||
default: | ||
break | ||
} | ||
#endif | ||
} | ||
} | ||
} |