Commit 60f6db6f authored by Kirill Smelkov's avatar Kirill Smelkov

libgolang: Provide nil as alias for nullptr and NULL

Nil is more native to Go.
parent d0179796
# cython: language_level=2
# Copyright (C) 2019 Nexedi SA and Contributors.
# Kirill Smelkov <kirr@nexedi.com>
# Copyright (C) 2019-2020 Nexedi SA and Contributors.
# Kirill Smelkov <kirr@nexedi.com>
#
# This program is free software: you can Use, Study, Modify and Redistribute
# it under the terms of the GNU General Public License version 3, or (at your
......@@ -44,7 +44,7 @@ In addition to Cython/nogil API, golang.pyx provides runtime for golang.py:
"""
from libcpp cimport nullptr_t, nullptr as nil
from libcpp cimport nullptr_t, nullptr as nil # golang::nil = nullptr
from libcpp.utility cimport pair
from libc.stdint cimport uint64_t
cdef extern from *:
......
#ifndef _NXD_LIBGOLANG_H
#define _NXD_LIBGOLANG_H
// Copyright (C) 2018-2019 Nexedi SA and Contributors.
// Copyright (C) 2018-2020 Nexedi SA and Contributors.
// Kirill Smelkov <kirr@nexedi.com>
//
// This program is free software: you can Use, Study, Modify and Redistribute
......@@ -377,6 +377,9 @@ LIBGOLANG_API extern void (*_tblockforever)(void);
namespace golang {
// nil is alias for nullptr and NULL.
constexpr nullptr_t nil = nullptr;
// string is alias for std::string.
using string = std::string;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment