Skip to content

Commit cc85388

Browse files
authored
Update OGVersion (#96)
1 parent 86fb886 commit cc85388

File tree

12 files changed

+100
-40
lines changed

12 files changed

+100
-40
lines changed

Package.resolved

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ let openGraphTestTarget = Target.testTarget(
138138
let openGraphCompatibilityTestTarget = Target.testTarget(
139139
name: "OpenGraphCompatibilityTests",
140140
dependencies: [
141-
.product(name: "RealModule", package: "swift-numerics"),
141+
.product(name: "Numerics", package: "swift-numerics"),
142142
],
143143
exclude: ["README.md"],
144144
cSettings: sharedCSettings,

Sources/OpenGraph/Export.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
11
@_exported public import OpenGraph_SPI
2+
3+
// Align the constant define behavior
4+
#if OPENGRAPH_RELEASE_2024
5+
public let OPENGRAPH_RELEASE: Int32 = 2024
6+
#elseif OPENGRAPH_RELEASE_2021
7+
public let OPENGRAPH_RELEASE: Int32 = 2021
8+
#endif

Sources/OpenGraph_SPI/OGBase.h

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,20 @@
55
#ifndef OGBase_h
66
#define OGBase_h
77

8-
#include "OGVersion.h"
9-
108
#if DEBUG
119
#define OG_ASSERTION
1210
#else
1311
#undef OG_ASSERTION
1412
#endif
1513

1614
#if __has_attribute(cold)
17-
#define __cold __attribute__((__cold__))
15+
#define __cold __attribute__((__cold__))
1816
#else
1917
#define __cold
2018
#endif
2119

2220
#if __has_attribute(noreturn)
23-
#define __dead2 __attribute__((__noreturn__))
21+
#define __dead2 __attribute__((__noreturn__))
2422
#else
2523
#define __dead2
2624
#endif
@@ -45,11 +43,11 @@
4543
#define OG_CONSTEXPR
4644
#endif
4745

46+
#include "OGSwiftSupport.h"
47+
#include "OGTargetConditionals.h"
4848
#include <CoreFoundation/CoreFoundation.h>
49-
#include <stdint.h>
5049
#include <stdbool.h>
51-
#include "OGTargetConditionals.h"
52-
#include "OGSwiftSupport.h"
50+
#include <stdint.h>
5351

5452
#define OG_ENUM CF_ENUM
5553
#define OG_OPTIONS CF_OPTIONS

Sources/OpenGraph_SPI/OGVersion.h

Lines changed: 0 additions & 17 deletions
This file was deleted.

Sources/OpenGraph_SPI/Runtime/OGTypeID.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ OGTypeKind OGTypeGetKind(OGTypeID typeID) {
4040
#endif
4141
}
4242

43-
#if OPENGRAPH_RELEASE >= 2024
43+
#if OPENGRAPH_RELEASE >= OPENGRAPH_RELEASE_2024
4444

4545
void const* OGTypeGetSignature(OGTypeID typeID) {
4646
#ifdef OPENGRAPH_SWIFT_TOOLCHAIN_SUPPORTED

Sources/OpenGraph_SPI/Runtime/OGTypeID.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#define OGTypeID_h
1010

1111
#include "OGBase.h"
12+
#include "OGVersion.h"
1213

1314
OG_ASSUME_NONNULL_BEGIN
1415

@@ -35,7 +36,7 @@ OG_EXPORT
3536
OG_REFINED_FOR_SWIFT
3637
OGTypeKind OGTypeGetKind(OGTypeID typeID) OG_SWIFT_NAME(getter:Metadata.kind(self:));
3738

38-
#if OPENGRAPH_RELEASE >= 2024
39+
#if OPENGRAPH_RELEASE >= OPENGRAPH_RELEASE_2024
3940

4041
OG_EXPORT
4142
OG_REFINED_FOR_SWIFT
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
//
2+
// OGVersion.c
3+
// OpenGraph
4+
5+
#include "OGBase.h"
6+
#include "OGVersion.h"
7+
8+
#if OPENGRAPH_RELEASE == OPENGRAPH_RELEASE_2024
9+
const double OpenGraphVersionNumber __attribute__ ((used)) = (double)6.0;
10+
const unsigned char OpenGraphVersionString[] __attribute__ ((used)) = "@(#)PROGRAM:OpenGraph PROJECT:OpenGraph-6.0.87\n";
11+
const uint64_t OGVersion = 0x2001e;
12+
#elif OPENGRAPH_RELEASE == OPENGRAPH_RELEASE_2021
13+
const double OpenGraphVersionNumber __attribute__ ((used)) = (double)3.2;
14+
const unsigned char OpenGraphVersionString[] __attribute__ ((used)) = "@(#)PROGRAM:OpenGraph PROJECT:OpenGraph-3.2.1\n";
15+
const uint64_t OGVersion = 0x20014;
16+
#endif
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//
2+
// OGVersion.h
3+
// OpenGraph
4+
5+
#ifndef OGVersion_h
6+
#define OGVersion_h
7+
8+
#include "OGBase.h"
9+
10+
#define OPENGRAPH_RELEASE_2021 2021
11+
#define OPENGRAPH_RELEASE_2024 2024
12+
13+
#ifndef OPENGRAPH_RELEASE
14+
#define OPENGRAPH_RELEASE OPENGRAPH_RELEASE_2024
15+
#endif
16+
17+
OG_EXTERN_C_BEGIN
18+
19+
OG_EXPORT const uint64_t OGVersion;
20+
21+
OG_EXTERN_C_END
22+
23+
#endif /* OGVersion_h */
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
../OGVersion.h
1+
../Version/OGVersion.h

0 commit comments

Comments
 (0)