OverviewFilesCommitsIssuesDocsReleasesPeers

opencog-cogutil commits / 73129c6

Get rid of the macros.h file
73129c66f6b4150ed7d5ca65e0f169075cacb442
by Linas Vepštas <linasvepstas@gmail.com> · 2025-12-10T20:23:59.000Z

Changed files (5) +4 -67

opencog/util/CMakeLists.txt +0 -1
……@@ -109,7 +109,6 @@ INSTALL(FILES
109109 lazy_random_selector.h
110110 lazy_selector.h
111111 Logger.h
112 macros.h
113112 misc.h
114113 mt19937ar.h
115114 numeric.h
opencog/util/async_buffer.h +0 -1
……@@ -34,7 +34,6 @@
3434#include <opencog/util/concurrent_set.h>
3535#include <opencog/util/exceptions.h>
3636#include <opencog/util/Logger.h>
37#include <opencog/util/macros.h>
3837
3938namespace opencog
4039{
opencog/util/async_method_caller.h +0 -1
……@@ -35,7 +35,6 @@
3535#include <opencog/util/concurrent_stack.h>
3636#include <opencog/util/exceptions.h>
3737#include <opencog/util/Logger.h>
38#include <opencog/util/macros.h>
3938
4039namespace opencog
4140{
opencog/util/exceptions.h +4 -1
……@@ -31,7 +31,10 @@
3131
3232#include <stdarg.h>
3333#include <string.h>
34#include <opencog/util/macros.h>
34
35#define STRINGIFY(x) #x
36#define TOSTRING(x) STRINGIFY(x)
37#define TRACE_INFO " (" __FILE__ ":" TOSTRING(__LINE__) ")"
3538
3639namespace opencog
3740{
opencog/util/macros.h +0 -63
……@@ -1,63 +0,0 @@
1/*
2 * opencog/util/macros.h
3 *
4 * Copyright (C) 2002-2007 Novamente LLC
5 * All Rights Reserved
6 *
7 * Written by Nicu Tofan <xtnickx@users.sourceforge.net>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU Affero General Public License v3 as
11 * published by the Free Software Foundation and including the exceptions
12 * at http://opencog.org/wiki/Licenses
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU Affero General Public License
20 * along with this program; if not, write to:
21 * Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 */
24
25#ifndef _OPENCOG_MACROS_H
26#define _OPENCOG_MACROS_H
27
28/** \addtogroup grp_cogutil
29 * @{
30 */
31
32//! helper to create strings at compile time
33#define STRINGIFY(x) #x
34//! convert the symbol to a string
35#define TOSTRING(x) STRINGIFY(x)
36//! indicate current file and line using (file:line) format
37#define TRACE_INFO " (" __FILE__ ":" TOSTRING(__LINE__) ")"
38//! suppress compiler warnings about unused variables
39#define OC_UNUSED(varname) (void)varname;
40//! check the return value of a fread; sets b_read local variable
41//! to false for failure; b_read must have been declared before:
42//! bool b_read = true;
43#define FREAD_CK(ptr,size,count,stream) \
44 b_read = b_read && (fread(ptr,size,count,stream)==(size_t)count)
45//! check the b_read used for fread function and throw an exception
46//! if b_read is false
47#define CHECK_FREAD \
48 { if ( !b_read ) throw IOException(TRACE_INFO, "%s - failed to read.", __FUNCTION__ ); }
49
50
51/** @}*/
52
53/// macro available from gcc 4.7
54#ifndef _GLIBCXX_USE_NOEXCEPT
55# if __GNUC__ >= 4
56# define _GLIBCXX_USE_NOEXCEPT throw()
57/// For non-gnu systems...
58# else
59# define _GLIBCXX_USE_NOEXCEPT
60# endif
61#endif
62
63#endif // _OPENCOG_MACROS_H