mirror of
https://github.com/ostreedev/ostree.git
synced 2025-01-09 01:18:35 +03:00
Make enum generation private by default, export stub symbol
When we added enum type generation, the generated symbols used the `ostree_` prefix, and at the time that implied they were public. So we started (if built with libsoup) exporting `ostree_fetcher_config_flags_get_type`. I think it's not worth confusing ABI checkers, so let's export the dummy symbol forever, and switch enums to be private by default. We should revisit this and also export some auto-generated enum types for public enums, but that's a separate patch. Closes: #296 Approved by: gatispaeglis
This commit is contained in:
parent
f98b8bd0d7
commit
a5f703799f
@ -22,6 +22,7 @@ libostree_public_headers = \
|
||||
src/libostree/ostree.h \
|
||||
src/libostree/ostree-async-progress.h \
|
||||
src/libostree/ostree-core.h \
|
||||
src/libostree/ostree-dummy-enumtypes.h \
|
||||
src/libostree/ostree-mutable-tree.h \
|
||||
src/libostree/ostree-repo.h \
|
||||
src/libostree/ostree-types.h \
|
||||
|
@ -69,6 +69,7 @@ libostree_1_la_SOURCES = \
|
||||
src/libostree/ostree-cmdprivate.c \
|
||||
src/libostree/ostree-core-private.h \
|
||||
src/libostree/ostree-core.c \
|
||||
src/libostree/ostree-dummy-enumtypes.c \
|
||||
src/libostree/ostree-checksum-input-stream.c \
|
||||
src/libostree/ostree-checksum-input-stream.h \
|
||||
src/libostree/ostree-chain-input-stream.c \
|
||||
|
32
src/libostree/ostree-dummy-enumtypes.c
Normal file
32
src/libostree/ostree-dummy-enumtypes.c
Normal file
@ -0,0 +1,32 @@
|
||||
/* This file declares a stub function that is only exported
|
||||
* to pacify ABI checkers - no one could really have used it.
|
||||
*
|
||||
* Copyright (C) 2015 Red Hat, Inc.
|
||||
*
|
||||
* This library 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 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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 this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "ostree-dummy-enumtypes.h"
|
||||
|
||||
/* Exported for backwards compat - see
|
||||
* https://bugzilla.gnome.org/show_bug.cgi?id=764131
|
||||
* https://github.com/ostreedev/ostree/pull/294
|
||||
*/
|
||||
GType
|
||||
ostree_fetcher_config_flags_get_type (void)
|
||||
{
|
||||
return G_TYPE_INVALID;
|
||||
}
|
29
src/libostree/ostree-dummy-enumtypes.h
Normal file
29
src/libostree/ostree-dummy-enumtypes.h
Normal file
@ -0,0 +1,29 @@
|
||||
/* This file declares a stub function that is only exported
|
||||
* to pacify ABI checkers - no one could really have used it.
|
||||
*
|
||||
* Copyright (C) 2015 Red Hat, Inc.
|
||||
*
|
||||
* This library 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 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library 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 this library; if not, write to the
|
||||
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
* Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
#ifndef __GI_SCANNER__
|
||||
_OSTREE_PUBLIC GType
|
||||
ostree_fetcher_config_flags_get_type (void);
|
||||
#endif
|
@ -28,7 +28,7 @@
|
||||
|
||||
/*** BEGIN value-header ***/
|
||||
GType
|
||||
@enum_name@_get_type (void)
|
||||
_@enum_name@_get_type (void)
|
||||
{
|
||||
static volatile gsize the_type__volatile = 0;
|
||||
|
||||
|
@ -32,9 +32,8 @@ G_BEGIN_DECLS
|
||||
/*** END file-production ***/
|
||||
|
||||
/*** BEGIN enumeration-production ***/
|
||||
#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (@enum_name@_get_type ())
|
||||
_OSTREE_PUBLIC
|
||||
GType @enum_name@_get_type (void) G_GNUC_CONST;
|
||||
#define @ENUMPREFIX@_TYPE_@ENUMSHORT@ (_@enum_name@_get_type ())
|
||||
GType _@enum_name@_get_type (void) G_GNUC_CONST;
|
||||
|
||||
/*** END enumeration-production ***/
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user