1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-07 04:30:18 +02:00
guile/libguile/deprecated.c
Andy Wingo 66f9815c3f Reimplement guardians in Scheme
Also, shunt them off to a module, and deprecate the C interface.

* module/ice-9/guardians.scm: New file.
* am/bootstrap.am (SOURCES): Add new file.

* libguile.h: Remove guardians.h include.
* libguile/Makefile.am (libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES):
(DOT_X_FILES):
(DOT_DOC_FILES):
(modinclude_HEADERS): Remove guardians.[ch] files.
* libguile/init.c (scm_i_init_guile): Remove guardians.

* libguile/deprecated.h:
* libguile/deprecated.c (scm_make_guardian): Deprecate.
* module/ice-9/deprecated.scm: Add make-guardian shim.

* module/oop/goops.scm (<guardian>): Remove class; they no longer have a
tc16.

* module/ice-9/popen.scm: Add guardians module.
* test-suite/tests/eval.test:
* test-suite/tests/fluids.test:
* test-suite/tests/gc.test:
* test-suite/tests/guardians.test:
* test-suite/tests/threads.test:
* test-suite/tests/types.test: Use the guardians module.
2025-05-04 20:41:16 +02:00

69 lines
1.7 KiB
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/* Copyright 2003-2004,2006,2008-2018,2020,2021,2022,2025
Free Software Foundation, Inc.
This file is part of Guile.
Guile is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Guile is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
License for more details.
You should have received a copy of the GNU Lesser General Public
License along with Guile. If not, see
<https://www.gnu.org/licenses/>. */
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#define SCM_BUILDING_DEPRECATED_CODE
#include "deprecation.h"
#include "eval.h"
#include "gsubr.h"
#include "modules.h"
#include "threads.h"
#include "variable.h"
#include "deprecated.h"
#if (SCM_ENABLE_DEPRECATED == 1)
/* Deprecated functions go here. */
static SCM make_guardian_var;
static void
init_make_guardian_var (void)
{
make_guardian_var = scm_c_public_lookup ("ice-9 guardians", "make-guardian");
}
SCM
scm_make_guardian (void)
{
static scm_i_pthread_once_t once = SCM_I_PTHREAD_ONCE_INIT;
scm_i_pthread_once (&once, init_make_guardian_var);
scm_c_issue_deprecation_warning
("The scm_make_guardian C interface is deprecated. Invoke the Scheme "
"make-guardian procedure from (ice-9 guardians) instead.");
return scm_call_0 (scm_variable_ref (make_guardian_var));
}
void
scm_i_init_deprecated ()
{
#include "deprecated.x"
}
#endif /* SCM_ENABLE_DEPRECATED == 1 */