Skip to content

Commit

Permalink
Strengthen the note about ABI compatibility in tox.h.
Browse files Browse the repository at this point in the history
We really want to get all clients off this struct. We won't actually
remove it until 0.2, but we're going to break ABI compatibility with this
in various 0.1.x releases.
  • Loading branch information
iphydf committed Dec 16, 2016
1 parent 4dccd66 commit bf6db32
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 16 deletions.
14 changes: 6 additions & 8 deletions toxcore/tox.api.h
Original file line number Diff line number Diff line change
Expand Up @@ -428,19 +428,17 @@ typedef void log_cb(LOG_LEVEL level, string file, uint32_t line, string func, st

static class options {
/**
* This struct contains all the startup options for Tox. You can either
* allocate this object yourself, and pass it to $default, or call $new to get
* a new default options object.
* This struct contains all the startup options for Tox. You must $new to
* allocate an object of this type.
*
* If you allocate it yourself, be aware that your binary will rely on the
* memory layout of this struct. In particular, if additional fields are added
* in future versions of the API, code that allocates it itself will become
* incompatible.
* WARNING: Although this struct happens to be visible in the API, it is
* effectively private. Do not allocate this yourself or access members
* directly, as it *will* break binary compatibility frequently.
*
* @deprecated The memory layout of this struct (size, alignment, and field
* order) is not part of the ABI. To remain compatible, prefer to use $new to
* allocate the object and accessor functions to set the members. The struct
* will become opaque (i.e. the definition will become private) in v0.1.0.
* will become opaque (i.e. the definition will become private) in v0.2.0.
*/
struct this [get, set] {
/**
Expand Down
14 changes: 6 additions & 8 deletions toxcore/tox.h
Original file line number Diff line number Diff line change
Expand Up @@ -477,19 +477,17 @@ typedef void tox_log_cb(Tox *tox, TOX_LOG_LEVEL level, const char *file, uint32_


/**
* This struct contains all the startup options for Tox. You can either
* allocate this object yourself, and pass it to tox_options_default, or call tox_options_new to get
* a new default options object.
* This struct contains all the startup options for Tox. You must tox_options_new to
* allocate an object of this type.
*
* If you allocate it yourself, be aware that your binary will rely on the
* memory layout of this struct. In particular, if additional fields are added
* in future versions of the API, code that allocates it itself will become
* incompatible.
* WARNING: Although this struct happens to be visible in the API, it is
* effectively private. Do not allocate this yourself or access members
* directly, as it *will* break binary compatibility frequently.
*
* @deprecated The memory layout of this struct (size, alignment, and field
* order) is not part of the ABI. To remain compatible, prefer to use tox_options_new to
* allocate the object and accessor functions to set the members. The struct
* will become opaque (i.e. the definition will become private) in v0.1.0.
* will become opaque (i.e. the definition will become private) in v0.2.0.
*/
struct Tox_Options {

Expand Down

0 comments on commit bf6db32

Please sign in to comment.