Restruct launcher source code. Separate classes in different files to improve mainten...
[anna.git] / include / anna / config / defines.hpp
index c832801..e69de29 100644 (file)
@@ -1,150 +0,0 @@
-// ANNA - Anna is Not 'N' Anymore
-//
-// (c) Copyright 2005-2014 Eduardo Ramos Testillano & Francisco Ruiz Rayo
-//
-// https://bitbucket.org/testillano/anna
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Authors: eduardo.ramos.testillano@gmail.com
-//          cisco.tierra@gmail.com
-
-
-#ifndef anna_config_defines_hpp
-#define anna_config_defines_hpp
-
-#include <sys/types.h>
-
-#ifdef ANNA_FILE_LOCATION
-#undef ANNA_FILE_LOCATION
-#endif
-#define ANNA_FILE_LOCATION (const char *)__FILE__,(const int)__LINE__
-//#define ANNA_FILE_LOCATION __PRETTY_FUNCTION__,(const char *)__FILE__,(const int)__LINE__
-
-
-#define ANNA_VERSION 0x000d03
-
-#if defined(__linux__) && !defined (_NO_BUILTIN)
-#define anna_memcpy(a,b,c) __builtin_memcpy((a),(b),(c))
-#define anna_memset(a,b,c) __builtin_memset((a),(b),(c))
-#define anna_memmove(a,b,c) __builtin_memmove((a),(b),(c))
-#define anna_strcpy(a,b) __builtin_strcpy((a),(b))
-#define anna_strncpy(a,b,c) __builtin_strncpy((a),(b),(c))
-#define anna_strcmp(a,b) __builtin_strcmp((a),(b))
-#define anna_strncmp(a,b,n) __builtin_strncmp((a),(b),(n))
-#define anna_strcat(a,b) __builtin_strcat((a),(b))
-#define anna_strlen(a) __builtin_strlen((a))
-#define anna_strstr(a,b) __builtin_strstr((a),(b))
-#define anna_strchr(a,b) __builtin_strchr((a),(b))
-#else
-#define anna_memcpy(a,b,c) memcpy((a),(b),(c))
-#define anna_memset(a,b,c) memset((a),(b),(c))
-#define anna_memmove(a,b,c) memmove((a),(b),(c))
-#define anna_strcpy(a,b) strcpy((a),(b))
-#define anna_strncpy(a,b,c) strncpy((a),(b),(c))
-#define anna_strcmp(a,b) strcmp((a),(b))
-#define anna_strncmp(a,b,n) strncmp((a),(b),(n))
-#define anna_strcat(a,b) strcat((a),(b))
-#define anna_strlen(a) strlen((a))
-#define anna_strstr(a,b) strstr((a),(b))
-#define anna_strchr(a,b) strchr((a),(b))
-#endif
-
-#define anna_signal_shield(r,a) { register int cx (0); do { if ((r = (a)) < 0) cx ++; } while (r < 0 && errno == EINTR && cx < 5); }
-
-//#define anna_append_string(str,str1,str2) (str).append (str1).append (str2)
-
-#ifndef _NOTRACE
-#define LOGWARNING(a) if (anna::Logger::isActive (anna::Logger::Warning) == true) {a;}
-#define LOGNOTICE(a) if (anna::Logger::isActive (anna::Logger::Notice) == true) {a;}
-#define LOGINFORMATION(a) if (anna::Logger::isActive (anna::Logger::Information) == true) {a;}
-#define LOG_EXCL_INFORMATION(a) if (anna::Logger::isActive (anna::Logger::Debug) == false && anna::Logger::isActive (anna::Logger::Information) == true) {a;}
-#define LOGDEBUG(a) if (anna::Logger::isActive (anna::Logger::Debug) == true) {a;}
-#define LOGLOCAL0(a) if (anna::Logger::isActive (anna::Logger::Local0) == true) {a;}
-#define LOGLOCAL1(a) if (anna::Logger::isActive (anna::Logger::Local1) == true) {a;}
-#define LOGLOCAL2(a) if (anna::Logger::isActive (anna::Logger::Local2) == true) {a;}
-#define LOGLOCAL3(a) if (anna::Logger::isActive (anna::Logger::Local3) == true) {a;}
-#define LOGLOCAL4(a) if (anna::Logger::isActive (anna::Logger::Local4) == true) {a;}
-#define LOGLOCAL5(a) if (anna::Logger::isActive (anna::Logger::Local5) == true) {a;}
-#define LOGLOCAL6(a) if (anna::Logger::isActive (anna::Logger::Local6) == true) {a;}
-#define LOGLOCAL7(a) if (anna::Logger::isActive (anna::Logger::Local7) == true) {a;}
-#define LOGMETHOD(a) a;
-#define LOGFUNCTION(a) a;
-#else
-#define LOGWARNING(a)
-#define LOGNOTICE(a)
-#define LOGINFORMATION(a)
-#define LOGDEBUG(a)
-#define LOGLOCAL0(a)
-#define LOGLOCAL1(a)
-#define LOGLOCAL2(a)
-#define LOGLOCAL3(a)
-#define LOGLOCAL4(a)
-#define LOGLOCAL5(a)
-#define LOGLOCAL6(a)
-#define LOGLOCAL7(a)
-#define LOGMETHOD(a)
-#define LOGFUNCTION(a)
-#endif
-
-#ifdef _MT
-#define WHEN_MULTITHREAD(a) a
-#define WHEN_SINGLETHREAD(a)
-#else
-#define WHEN_MULTITHREAD(a)
-#define WHEN_SINGLETHREAD(a) a
-#endif
-
-namespace anna {
-#ifndef __x86_64__
-#undef  __anna64__
-typedef int64_t Integer64;
-typedef u_int64_t Unsigned64;
-
-/**
- * Defines required data type to conversion from pointer to integer
- */
-typedef int ptrnumber;
-#else
-#define __anna64__
-typedef long long Integer64;
-typedef unsigned long long Unsigned64;
-
-/**
- * Defines required data type to conversion from pointer to integer
- */
-typedef long ptrnumber;
-#endif
-}
-
-/**
- * Make conversion from pointer to integer, it will work both 64 bits and 32 bits architecture.
- */
-#define anna_ptrnumber_cast(pointer) (anna::ptrnumber)((void*)(pointer))
-
-#endif
-