deprecate refs

This commit is contained in:
Andrei Alexeyev 2021-02-20 01:39:15 +02:00
parent 5b2e2b248d
commit 3ecadebcfd
No known key found for this signature in database
GPG key ID: 72D26128040B9690
2 changed files with 8 additions and 2 deletions

View file

@ -15,6 +15,9 @@
* NOTE: if you're here to attempt fixing any of this braindeath, better just delete the file and start over
*/
PRAGMA(message "Delete this file when no users left")
DIAGNOSTIC(ignored "-Wdeprecated-declarations")
void *_FREEREF;
#ifdef DEBUG

View file

@ -20,15 +20,18 @@ typedef struct {
int refs;
} Reference;
#define DEPRECATED_REFS \
attr_deprecated("Use tasks and boxed entities instead")
typedef struct {
Reference *ptrs;
Reference *ptrs DEPRECATED_REFS;
int count;
} RefArray;
extern void *_FREEREF;
#define FREEREF &_FREEREF
#define REF(p) (global.refs.ptrs[(int)(p)].ptr)
int add_ref(void *ptr);
int add_ref(void *ptr) DEPRECATED_REFS;
void del_ref(void *ptr);
void free_ref(int i);
void free_all_refs(void);