Skip to content

Commit f687907

Browse files
committed
Make it work one last time
1 parent 3adedc0 commit f687907

File tree

6 files changed

+76
-50
lines changed

6 files changed

+76
-50
lines changed
File renamed without changes.

package-dev/Runtime/Sentry.Unity.Native.PlayStation.dll.meta

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

src/Sentry.Unity.Native/Sentry.Unity.Native.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
<Csc
1414
Sources="@(Compile)"
1515
References="@(ReferencePath)"
16-
OutputAssembly="$(OutDir)Sentry.Unity.Native.Console.dll"
17-
DefineConstants="$(DefineConstants);SENTRY_NATIVE_STATIC"
16+
OutputAssembly="$(OutDir)Sentry.Unity.Native.PlayStation.dll"
17+
DefineConstants="$(DefineConstants);SENTRY_NATIVE_PLAYSTATION"
1818
TargetType="library"
1919
EmitDebugInformation="true"
2020
/>

src/Sentry.Unity.Native/SentryNativeBridge.cs

Lines changed: 3 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -114,84 +114,40 @@ internal static string GetCacheDirectory(SentryUnityOptions options)
114114
internal static void ReinstallBackend() => sentry_reinstall_backend();
115115

116116
// libsentry.so
117-
#if SENTRY_NATIVE_STATIC
118-
[DllImport("__Internal")]
119-
#else
120117
[DllImport("sentry")]
121-
#endif
122118
private static extern IntPtr sentry_options_new();
123119

124-
#if SENTRY_NATIVE_STATIC
125-
[DllImport("__Internal")]
126-
#else
127120
[DllImport("sentry")]
128-
#endif
129121
private static extern void sentry_options_set_dsn(IntPtr options, string dsn);
130122

131-
#if SENTRY_NATIVE_STATIC
132-
[DllImport("__Internal")]
133-
#else
134123
[DllImport("sentry")]
135-
#endif
136124
private static extern void sentry_options_set_release(IntPtr options, string release);
137125

138-
#if SENTRY_NATIVE_STATIC
139-
[DllImport("__Internal")]
140-
#else
141126
[DllImport("sentry")]
142-
#endif
143127
private static extern void sentry_options_set_debug(IntPtr options, int debug);
144128

145-
#if SENTRY_NATIVE_STATIC
146-
[DllImport("__Internal")]
147-
#else
148129
[DllImport("sentry")]
149-
#endif
150130
private static extern void sentry_options_set_environment(IntPtr options, string environment);
151131

152-
#if SENTRY_NATIVE_STATIC
153-
[DllImport("__Internal")]
154-
#else
155132
[DllImport("sentry")]
156-
#endif
157133
private static extern void sentry_options_set_sample_rate(IntPtr options, double rate);
158134

159-
#if SENTRY_NATIVE_STATIC
160-
[DllImport("__Internal")]
161-
#else
162135
[DllImport("sentry")]
163-
#endif
164136
private static extern void sentry_options_set_database_path(IntPtr options, string path);
165137

166-
#if SENTRY_NATIVE_STATIC
167-
[DllImport("__Internal")]
168-
#else
169138
[DllImport("sentry")]
170-
#endif
171139
private static extern void sentry_options_set_database_pathw(IntPtr options, [MarshalAs(UnmanagedType.LPWStr)] string path);
172140

173-
#if SENTRY_NATIVE_STATIC
174-
[DllImport("__Internal")]
175-
#else
176141
[DllImport("sentry")]
177-
#endif
178142
private static extern void sentry_options_set_auto_session_tracking(IntPtr options, int debug);
179143

180-
#if SENTRY_NATIVE_STATIC
181-
[DllImport("__Internal")]
182-
#else
183144
[DllImport("sentry")]
184-
#endif
185145
private static extern void sentry_options_set_attach_screenshot(IntPtr options, int attachScreenshot);
186146

187147
[UnmanagedFunctionPointer(CallingConvention.Cdecl, SetLastError = true)]
188148
private delegate void sentry_logger_function_t(int level, IntPtr message, IntPtr argsAddress, IntPtr userData);
189149

190-
#if SENTRY_NATIVE_STATIC
191-
[DllImport("__Internal")]
192-
#else
193150
[DllImport("sentry")]
194-
#endif
195151
private static extern void sentry_options_set_logger(IntPtr options, sentry_logger_function_t logger, IntPtr userData);
196152

197153
// The logger we should forward native messages to. This is referenced by nativeLog() which in turn for.
@@ -287,11 +243,11 @@ private static void nativeLogImpl(int cLevel, IntPtr format, IntPtr args, IntPtr
287243
}
288244
}
289245

290-
// For Mono (Windows/Linux): use platform's native C library directly
291-
#if SENTRY_NATIVE_STATIC
246+
#if SENTRY_NATIVE_PLAYSTATION
292247
[DllImport("__Internal", EntryPoint = "vsnprintf_sentry")]
293248
private static extern int vsnprintf_sentry(IntPtr buffer, UIntPtr bufferSize, IntPtr format, IntPtr args);
294249
#else
250+
// For Windows/Linux: use platform's native C library directly
295251
[DllImport("msvcrt", EntryPoint = "vsnprintf")]
296252
private static extern int vsnprintf_windows(IntPtr buffer, UIntPtr bufferSize, IntPtr format, IntPtr args);
297253

@@ -301,7 +257,7 @@ private static void nativeLogImpl(int cLevel, IntPtr format, IntPtr args, IntPtr
301257

302258
private static int vsnprintf(IntPtr buffer, UIntPtr bufferSize, IntPtr format, IntPtr args)
303259
{
304-
#if SENTRY_NATIVE_STATIC
260+
#if SENTRY_NATIVE_PLAYSTATION
305261
return vsnprintf_sentry(buffer, bufferSize, format, args);
306262
#else
307263
return _isWindows

src/Sentry.Unity/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using System.Runtime.CompilerServices;
22

33
[assembly: InternalsVisibleTo("Sentry.Unity.Native")]
4-
[assembly: InternalsVisibleTo("Sentry.Unity.Native.Console")]
4+
[assembly: InternalsVisibleTo("Sentry.Unity.Native.PlayStation")]
55
[assembly: InternalsVisibleTo("Sentry.Unity.Tests")]
66
[assembly: InternalsVisibleTo("Sentry.Unity.Editor")]
77
[assembly: InternalsVisibleTo("Sentry.Unity.Editor.Tests")]

0 commit comments

Comments
 (0)