1

Possible Duplicate:
How can I conditionally compile my C# for Mono vs. Microsoft .NET?

I have sqlite in my project and I'd like to run it in mono. The code is exactly the same for mono and nonmono however mono needs me to include a different namespace. Does mono have a predefined macro? Right now i define USE_MONO. Is there an official definition i can use?

#if USE_MONO
using Mono.Data.Sqlite;
#else
using System.Data.SQLite;
#endif
Community
  • 1
  • 1

1 Answers1

1

(From the duplicate question) The mono compiler defines __MonoCS__ for this purpose so you can use:

#if __MonoCS__
using Mono.Data.Sqlite;
#else
using System.Data.SQLite;
#endif
Community
  • 1
  • 1
M.Babcock
  • 18,753
  • 6
  • 54
  • 84