/[svn]/gigedit/trunk/src/gigedit/global.h
ViewVC logotype

Diff of /gigedit/trunk/src/gigedit/global.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2442 by persson, Sun Apr 14 07:29:59 2013 UTC revision 2604 by schoenebeck, Sat Jun 7 22:34:31 2014 UTC
# Line 1  Line 1 
1  /*                                                         -*- c++ -*-  /*                                                         -*- c++ -*-
2   * Copyright (C) 2007 Andreas Persson   * Copyright (C) 2007-2013 Andreas Persson
3   *   *
4   * This program is free software; you can redistribute it and/or   * This program is free software; you can redistribute it and/or
5   * modify it under the terms of the GNU General Public License as   * modify it under the terms of the GNU General Public License as
# Line 26  Line 26 
26    
27  #include <sstream>  #include <sstream>
28    
29  #if HAVE_GETTEXT  //FIXME: for some reason AC GETTEXT check fails on the Mac cross compiler?
30    #if (HAVE_GETTEXT || defined(__APPLE__))
31  # include <libintl.h>  # include <libintl.h>
32  # define _(String) gettext(String)  # define _(String) gettext(String)
33  #else  #else
# Line 45  template<class T> inline std::string ToS Line 46  template<class T> inline std::string ToS
46      return ss.str();      return ss.str();
47  }  }
48    
49    /// Find the number of bits required to hold the specified amount of zones.
50    inline int zoneCountToBits(int nZones) {
51        if (!nZones) return 0;
52        int iFinalBits = 0;
53        int zoneBits = nZones - 1;
54        for (; zoneBits > 1; iFinalBits += 2, zoneBits >>= 2);
55        iFinalBits += zoneBits;
56        return iFinalBits;
57    }
58    
59  #endif // GIGEDIT_GLOBAL_H  #endif // GIGEDIT_GLOBAL_H

Legend:
Removed from v.2442  
changed lines
  Added in v.2604

  ViewVC Help
Powered by ViewVC