Skip to content

Commit e1e1447

Browse files
committed
[api headers] fix of C99 compatibility
1 parent 877f08f commit e1e1447

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

include/sciter-x-api.h

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -269,11 +269,7 @@ typedef ISciterAPI* (SCAPI *SciterAPI_ptr)();
269269

270270
EXTERN_C ISciterAPI* SCAPI SciterAPI();
271271

272-
#if defined(__cplusplus) && !defined(PLAIN_API_ONLY)
273-
inline ISciterAPI* SAPI( ISciterAPI* ext = NULL ) {
274-
#else
275-
inline ISciterAPI* SAPI(ISciterAPI* ext) {
276-
#endif
272+
inline ISciterAPI* _SAPI(ISciterAPI* ext) {
277273
static ISciterAPI* _api = NULL;
278274
if( ext ) _api = ext;
279275
if( !_api )
@@ -289,7 +285,7 @@ typedef ISciterAPI* (SCAPI *SciterAPI_ptr)();
289285

290286
#elif defined(WINDOWS)
291287

292-
inline ISciterAPI* SAPI( ISciterAPI* ext = NULL ) {
288+
inline ISciterAPI* _SAPI( ISciterAPI* ext ) {
293289
static ISciterAPI* _api = NULL;
294290
if( ext ) _api = ext;
295291
if( !_api )
@@ -316,12 +312,11 @@ typedef ISciterAPI* (SCAPI *SciterAPI_ptr)();
316312
return _api;
317313
}
318314

319-
320315
#elif defined(OSX)
321316

322317
//typedef ISciterAPI* SCAPI (*SciterAPI_ptr)();
323318

324-
inline ISciterAPI* SAPI( ISciterAPI* ext = NULL )
319+
inline ISciterAPI* _SAPI( ISciterAPI* ext )
325320
{
326321
static ISciterAPI* _api = NULL;
327322
if( ext ) _api = ext;
@@ -373,7 +368,7 @@ typedef ISciterAPI* (SCAPI *SciterAPI_ptr)();
373368

374369
//typedef ISciterAPI* SCAPI (*SciterAPI_ptr)();
375370

376-
inline ISciterAPI* SAPI( ISciterAPI* ext = NULL )
371+
inline ISciterAPI* _SAPI( ISciterAPI* ext )
377372
{
378373
static ISciterAPI* _api = NULL;
379374
if( ext ) _api = ext;
@@ -426,9 +421,13 @@ typedef ISciterAPI* (SCAPI *SciterAPI_ptr)();
426421
return _api;
427422
}
428423

429-
430424
#endif
431425

426+
inline ISciterAPI* SAPI() {
427+
static ISciterAPI* _api = _SAPI(NULL);
428+
return _api;
429+
}
430+
432431
inline LPSciterGraphicsAPI gapi()
433432
{
434433
return SAPI()->GetSciterGraphicsAPI();

0 commit comments

Comments
 (0)