(root)/
glib-2.79.0/
gmodule/
tests/
max-version.c
       1  /*
       2   * Copyright 2022 Collabora Ltd.
       3   * SPDX-License-Identifier: LGPL-2.1-or-later
       4   *
       5   * This library is free software; you can redistribute it and/or
       6   * modify it under the terms of the GNU Lesser General Public
       7   * License as published by the Free Software Foundation; either
       8   * version 2.1 of the License, or (at your option) any later version.
       9   *
      10   * This library is distributed in the hope that it will be useful,
      11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
      12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
      13   * Lesser General Public License for more details.
      14   *
      15   * You should have received a copy of the GNU Lesser General
      16   * Public License along with this library; if not, see
      17   * <http://www.gnu.org/licenses/>.
      18   */
      19  
      20  #ifndef GLIB_VERSION_MAX_ALLOWED
      21  /* This is the oldest version macro available */
      22  #define GLIB_VERSION_MIN_REQUIRED GLIB_VERSION_2_26
      23  #define GLIB_VERSION_MAX_ALLOWED GLIB_VERSION_2_26
      24  #endif
      25  
      26  #include <glib.h>
      27  
      28  #include <gmodule.h>
      29  
      30  static void
      31  nothing (void)
      32  {
      33    /* This doesn't really do anything: the real "test" is at compile time.
      34     * Just make sure the GModule library gets linked. */
      35    g_debug ("GModule supported: %s", g_module_supported () ? "yes" : "no");
      36  }
      37  
      38  int
      39  main (int   argc,
      40        char *argv[])
      41  {
      42    g_test_init (&argc, &argv, NULL);
      43  
      44    g_test_add_func ("/max-version/tested-at-compile-time", nothing);
      45    return g_test_run ();
      46  }